which gcc # Displays the path of the `gcc` command if it is installed.
pwd # Prints the current working directory.
ls # Lists the files and directories in the current directory.
ls / # Lists the files and directories in the root directory.
echo $SHELL # Displays the current shell being used.
pwd # Prints the current working directory.
ls # Lists the files and directories in the current directory.
which gcc # Displays the path of the `gcc` command if it is installed.
date # Displays the current date and time.
cal # Displays the calendar for the current month.
cal -y # Displays the calendar for the current year.
cal -y 2022 # Displays the calendar for the year 2022.
man cal # Opens the manual page for the `cal` command.
uname # Displays the system information (e.g., OS name).
uname -r # Displays the kernel release version.
uname -a # Displays all system information.
man uname # Opens the manual page for the `uname` command.
ls /home/ # Lists the files and directories in the `/home/` directory.
ls /home/kiran/ # Lists the files and directories in the
ls # Lists the files and directories in the current directory.
mkdir dbda # Creates a new directory named `dbda`.
cd dbda/ # Changes the current directory to `dbda/`.
ls # Lists the files and directories in the current directory.
pwd # Prints the current working directory.
ls # Lists the files and directories in the current directory.
mkdir demo # Creates a new directory named `demo`.
ls # Lists the files and directories in the current directory.
mkdir one two three four # Creates four directories named `one`, `two`, `three`,
and `four`.
ls # Lists the files and directories in the current directory.
mkdir -p dir1/dir2/dir3/dir4 # Creates a nested directory structure.
ls # Lists the files and directories in the current directory.
ls dir1 # Lists the files and directories in `dir1`.
ls dir1/dir2/ # Lists the files and directories in `dir1/dir2/`.
ls dir1/dir2/dir3/ # Lists the files and directories in `dir1/dir2/dir3/`.
ls -R # Recursively lists all files and directories.
ls -a # Lists all files, including hidden files.
ls # Lists the files and directories in the current directory.
ls -a demo/ # Lists all files, including hidden files, in the `demo/` directory.
cd demo/ # Changes the current directory to `demo/`.
cd .. # Moves up one directory level.
pwd # Prints the current working directory.
cd ~ # Changes the current directory to the home directory.
pwd # Prints the current working directory.
cd - # Switches to the previous working directory.
pwd # Prints the current working directory.
cd . # Stays in the current directory (no change).
touch file1.txt # Creates an empty file named `file1.txt`.
ls # Lists the files and directories in the current directory.
touch file2.txt file3.txt file4.txt # Creates three empty files: `file2.txt`,
`file3.txt`, and `file4.txt`.
ls # Lists the files and directories in the current directory.
ls demo/ # Lists the files and directories in the `demo/` directory.
cp file1.txt demo # Copies `file1.txt` to the `demo/` directory.
ls demo/ # Lists the files and directories in the `demo/` directory.
cp file1.txt copy.txt # Copies `file1.txt` to a new file named `copy.txt`.
ls # Lists the files and directories in the current directory.
cp demo newdemo # Copies the `demo/` directory to `newdemo/`.
cp -r demo newdemo # Recursively copies the `demo/` directory to `newdemo/`.
ls # Lists the files and directories in the current directory.
ls demo/ # Lists the files and directories in the `demo/` directory.
ls newdemo/ # Lists the files and directories in the `newdemo/` directory.
cp -r demo one # Recursively copies the `demo/` directory to `one/`.
ls # Lists the files and directories in the current directory.
ls one/ # Lists the files and directories in the `one/` directory.
ls # Lists the files and directories in the current directory.
mv file1.txt one # Moves `file1.txt` to the `one/` directory.
ls # Lists the files and directories in the current directory.
ls one/ # Lists the files and directories in the `one/` directory.
mv file2.txt newfile2.txt # Renames `file2.txt` to `newfile2.txt`.
ls # Lists the files and directories in the current directory.
rmdir two # Removes the empty directory `two`.
ls # Lists the files and directories in the current directory.
rmdir demo # Attempts to remove the `demo/` directory (fails if not empty).
ls demo/ # Lists the files and directories in the `demo/` directory.
rm -r demo # Recursively removes the `demo/` directory and its contents.
ls # Lists the files and directories in the current directory.
rm newfile2.txt # Deletes the file `newfile2.txt`.
ls # Lists the files and directories in the current directory.
ls -a # Lists all files, including hidden files.
mv copy.txt .copy.txt # Renames `copy.txt` to `.copy.txt` (makes it hidden).
ls # Lists the files and directories in the current directory.
ls -a # Lists all files, including hidden files.
history # Displays the command history.