-
Notifications
You must be signed in to change notification settings - Fork 7
BioLinux crash course
Antonio Fernandez-Guerra edited this page Nov 3, 2015
·
1 revision
A compilation of some commonly used Linux commands for beginners (and those of us who often just forget :)) Forked from https://github.com/petronbot/Linux-Commands-Cheat-Sheet
Some common commands for navigating, moving, deleting & more!
cd /path/to/folder
mkdir folder
mkdir folder && cd folder
mv /path/to/file.txt /path/to/dest/
mv /path/to/folder1 /path/to/dest/
mv folder1 folder2 /path/to/dest/
ls -l
tar -cvzf filename.tar.gz folder/
tar -xvzf filename.tar.gz
sed -i '' 's/old/new/g' file.ext
-
sed
= Stream EDitor -
-i
= in-place (i.e. save back to original file) -
old
= regex to replace -
new
= text to replace it with -
g
= global (i.e. replace all, not just first)
Securely (over SSH) and locally
cp /path/to/file.txt /path/to/dest
cp -r /path/to/folder /path/to/dest
rsync -a /path/to/folder /path/to/dest
-
-a
= Archive, syncs recursively and preserves sym links, special and device files, modification times, group, owner, and permissions - Source folder can be a remote, e.g.
[email protected]:/path/to/folder
For more info on types of permissions and what they mean, go here
chmod 755 file.txt
chmod -R 755 /path/to/folder