Shell Navigation Meeting 26 - 01 - 2023
Shell Navigation Meeting 26 - 01 - 2023
============================
Deep Dive Into Shell Navigation
clear: Clears all the previous commands in the terminal. You can also use the shortcut
ctrl + L
uname: Tells the environment you're working on or your operating system (ex:Linux)
pwd: Locate your location. Or which directory you are currently in.
echo: Gives you back anything you give it. Ex input: echo "ALX is awesome."
Output: ALX is awesome.
it gives the input as it is back to me in the next line as an output.
if I want to write some content in a certain file we write the command; echo "the content I
want to type in a file called file_name" > file_name
if we want to see the content we wrote in the file file_name we use the command cat file,
it gives us what we wrote before which is the content I want to type in a file called
file_name.
if we want to write something else with the same command it rewrites it, so if we want to
add content to the previous content we use >> instead of >.
cd: To change the current directory or move to a certain directory ex: cd directory.
ls -a: Shows me the hidden files or directories inside the directory I am currently in.
file: Tells you the type of the file weither it is a text file or a directory.
Ex: file directory_name
Output: directory_name: directory
mv: Use it to rename a directory or a file. also you can use it to move files or directories
to another directory.
cp: Lets you copy the content of a certain directory to another directory or new
directory.
rm: To delete a certain file use rm name_of_file.py. if we want to delete all the files that
ends with .py we use the *, ex: rm *.py.
rm -r: To delete a directory. Be carefully careful when doing so because you can't undo
this action, if you deleted an important directory you can not bring it back.
rmdir: Removes only the empty directories. it will give you an error if the directory you
are trying to remove is not empty.
man: Gives you all the commands related to the main command, ex: man ls . it gives the
description of that command as well as all the related commands such as ls -r and ls -l.