Basic 🐧 Linux commands

Basic 🐧 Linux commands

lslists files and folders
ls -lrtlists files and folders in datel order
ls -lalist hidden files and folders and visible
cd /foldercd means to change folder where folder is a valid folder
cd /changes you back to the root path
cd ..changes folders back one level
mountshow existing partitions 
mount -amount all partitions in files /etc/fstab
mount /mnt/cdrom  mounts the cd-rom drive providing a disc is inserted, replacing cd-rom with floppy will mount the floppy dirve
vi filenameedit a file where filename is a valid filename
find /etc -name expo*find files, syntax is (find “start at path” “type of file to find” filename and wildcards), in this example I am looking for all files that start with expo in the location of the /etc folder
locate expo*also allows you to find files
cp /path/file1 /path/copy_of_file1copy a file or folder to another location and using the -R after cp if its a folder copies all the contents of the folder too.
mv /path/file1 /path/copy_of_file1move a file or folder to another location or rename the file using the -R after mv if its a folder moves all the contents of the folder too.
rm file1deletes a file or folder is you wish to delete without being prompted use -f  using the -R after rm if its a folder removes all the contents of the folder too. using -Rf move everything in a folder without being prompted. warning using the rm command or -R with the rm command can be dangerous if incorrect attention is paid
dfshows the amount of space available on each partition.
su – or username –allows you to shell to root or another username and runs that user’s login script
 
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.