The Linux Commands Cheatsheat

Posted by : at

Category : linux

Move Files

mv old-file-name new-file-name
mv [options] old-file-name new-file-name
mv file1 file2

Renaming Files

We can use mv command to rename a file:

mv /var/www/myfilae.pdf /var/www/myfile.pdf

Get a verbose output :

mv -v file1 file2

file1' -> file2’

Copy Files

copy file.pdf and paste inside folder “myfolder”

cp -a /var/www/file.pdf /var/www/myfolder/file.pdf

copy all the files of folder2 in folder3

cp -a /var/www/folder2/. /var/www/folder3/

Compress - Create Zip Files to Specific Directory

We need to install zip package :

$ sudo apt install zip
$ zip -r tecmint_files

To unzip

$ unzip

To unzip in a particular directory

$ mkdir -p /tmp/unziped
$ unzip -d /tmp/unziped
$ ls -l /tmp/unziped/

About hack4r

A Platform built for Security Enthusiasts and Ethical Hackers

Useful Links