Basic shell commands are fundamental commands used in a command-line interface to perform various tasks. Here are some of the most common ones:
-
pwd:
- Stands for "print working directory."
- Displays the current directory you are in.
-
ls:
- Lists files and directories in the current directory.
- Options like
-l(long format) and-a(include hidden files) can be used.
-
cd:
- Stands for "change directory."
- Used to navigate between directories. For example,
cd /path/to/directory.
-
mkdir:
- Stands for "make directory."
- Creates a new directory. For example,
mkdir new_folder.
-
rm:
- Stands for "remove."
- Deletes files or directories. Use
-rfor recursive deletion of directories.
-
cp:
- Stands for "copy."
- Copies files or directories. For example,
cp source.txt destination.txt.
-
mv:
- Stands for "move."
- Moves or renames files or directories. For example,
mv oldname.txt newname.txt.
-
echo:
- Displays a line of text or the value of a variable.
- Example:
echo "Hello, World!".
-
cat:
- Concatenates and displays the content of files.
- Example:
cat file.txt.
-
man:
- Displays the manual page for a command.
- Example:
man lsshows the manual for thelscommand.
These commands form the basis of interacting with the shell and performing file management and navigation tasks.
