Creating, reading, updating, deleting and navigation on the command-line interface
mkdir my_folderlsto list all the content of the current working directory
cd my_folderto change the current working directory into the new directory createdcd ../to change to the previous directory
mv my_folder /home/<user-name>/Desktop to move my_folder to the Desktop
mv my_folder new_folder
cp -r new_folder my_folder copies the content of new_folder into my_folder
rmdir new_folder
rm -r new_folder when new_folder is not empty
touch my_filecat > my_filethenCtrl + CorCtrl + Dto create an empty file
cat > my_file+Enter or Return- you then type the content of the file, followed byCtrl + Cwhen you are donecat >> my_fileto append new content to the old content, without the second>,my_filewill be over writtenecho "string data" >> my_fileto write text intomy_filedirectlycat my_file >> some_new_fileto read the content ofmy_fileintosome_new_fileand ifsome_new_filedoes not exist, it will be created
cp my_file my_new_file
mv my_file /home/<user-name>/Desktop/ to move my_file to the Desktop
mv my_file new_file - Know that if new_file is a directory then my_file would be moved into new_file instead of renaming it
rm new_file
- visit CLI-presentation for this slides
- and I am Otumian-empire, just do
cd ../