Creating, reading, updating, deleting and navigation on the command-line interface
mkdir my_folder
ls
to list all the content of the current working directory
cd my_folder
to 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_file
cat > my_file
thenCtrl + C
orCtrl + D
to create an empty file
cat > my_file
+Enter or Return
- you then type the content of the file, followed byCtrl + C
when you are donecat >> my_file
to append new content to the old content, without the second>
,my_file
will be over writtenecho "string data" >> my_file
to write text intomy_file
directlycat my_file >> some_new_file
to read the content ofmy_file
intosome_new_file
and ifsome_new_file
does 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 ../