Skip to content

Instantly share code, notes, and snippets.

@pseudokool
Last active February 5, 2019 18:21
Show Gist options
  • Save pseudokool/26cf406837d7716cf253c75c829624dd to your computer and use it in GitHub Desktop.
Save pseudokool/26cf406837d7716cf253c75c829624dd to your computer and use it in GitHub Desktop.
A few useful Linux commands #quickref

Copy

all files and folders from Downloads to Archived

cp -a ~/Downloads/. ~/Archived/

brace expansion - copies index.php to index.php.bak

cp /var/www/vhosts/domain.com/httpdocs/index.php{,.bak}

Move/Rename

all the files and folders from Downloads to Archived

mv  -v ~/Downloads/* ~/Archived/

brace expansion - renames index.php to index.php.bak

mv /var/www/vhosts/domain.com/httpdocs/index.php{,.bak}

Delete

files and subfolders inside a folder

rm -rf ~/Downloads/*

only subfolders inside a folder

rm -rf ~/Downloads/*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment