Common Linux Commands I use

unzip archive:

> unzip filename.zip

or

>tar cfv test.tar test/

to get hidden files as well

Move contents of directory A to directory B

> mv -i ./A/* ./B

Copy contents of directory A to directory B

> cp -r ./A/* ./B

Remove directory

>rmdir ./A

or

>rm -rf ./A to remove all subdirectories and file

Untar file

tar -xvf ./file.tar

if zipped also use -zxvf

Taken from: http://www.geekvenue.net/chucktips/jason/chuck/994016279/index_html

If you would like to preserve the permissions of the files you backup, use the p option with the tar command. This will save the uid, gid as well as the specific permission attributes of the files (read, write, execute etc.)

tar pzcvf tarball.tgz .

You should also use the p option with the tar extraction command:

tar pxvf tarball.tgz .

Advertisements

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: