LINUX Basic Commands

Count a string in many files without opening them

cat * | grep -c string

Count the number of files in a directory

ls -l . | egrep -c ‘^-‘

Compressing a file in tar.bz2 format

tar jcvf .tar.bz2 dir1 dir2 file1 file2 …

Decompressing a file in tar.bz2 format

tar -xjvf example.tar.bz2

All files and directory would be compressed in the same folder

Counting Number of files in a folder

ls | wc -l

TODOS:

What exactly is bash?

Advertisements
Tagged

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: