pwd - to display the current working directory
ls - shows all the files and folders in a directory
cd [directoryname] - to switch into a directory
cd python-project
mkdir [directory name] - to make a new directory
mkdir machine-learning
touch [file name] - to make a file
touch output.txt
rm - to delete a file
rm output.txt
rm -r - to delete a directory and all the files within it
rm -r python-project
clear - to clear the terminal screen
clear
cd [full path from the root] - can navigate to any folder, but path must start from the root / (default root)
cd /home/user1
ls [full path from root] - show the content of the directory
ls /home
mv [filename] [new filename] - to rename a file
mv user1 new-user
cp -r [file to be copied] [copy file name] - to make a copy of the directory or file
- To copy a directory
cp -r folder1 folder 2
- To copy a file
cp file1 file 2
ls -R - to display the contents within the subfolders of a given folder
ls -R python/root
history - to see the list of the commands you have used previously
history
Ctrl + C - to kill a command execution in the terminal
Ctrl + C
Ctrl + shift + V - to paste a copied text in the terminal
Ctrl + shift + V
ls -a - to show all the hidden files
ls -a
cat - to show the contents of a file
cat
Top comments (0)