Commandline Basics
Command: pwd
Description: Prints the current working directory
Example: pwd #displays the full path of the current directory
echo "You are in $(pwd)" #Combining with Other CommandsCommand: ls
Description: Lists directory contents
Example:
ls -l #lists files in long format, showing permissions, owner, size, and modification date
ls -a #lists files, including hidden files (those starting with a dot)
ls -la #list directory contents in a long format, including hidden files
ls -l /etc/shadowCommand: cd
Description: Changes the current directory.
Example:
cd /home/user #changes the directory to /home/user
cd /home/user #Changing to a Specific Directory
cd .. #Moving Up One Directory Level
cd ~ #Moving to the Home Directory
cd - #Changing to the Previous Directory
cd /var/log #Using Absolute and Relative PathsLast updated