Here are some other basic Unix commands that are essential for navigating and managing files in the terminal:
-
ls: Lists the contents of a directory.- Example:
ls -lprovides a detailed list including file permissions, sizes, and modification dates.
- Example:
-
cd: Changes the current directory.- Example:
cd /home/usermoves you to the "user" directory.
- Example:
-
mkdir: Creates a new directory.- Example:
mkdir new_foldercreates a directory named "new_folder."
- Example:
-
rmdir: Removes an empty directory.- Example:
rmdir old_folderdeletes the "old_folder" if it is empty.
- Example:
-
touch: Creates a new empty file or updates the timestamp of an existing file.- Example:
touch file.txtcreates a new file named "file.txt."
- Example:
-
cp: Copies files or directories.- Example:
cp source.txt destination.txtcopies "source.txt" to "destination.txt."
- Example:
-
mv: Moves or renames files or directories.- Example:
mv oldname.txt newname.txtrenames "oldname.txt" to "newname.txt."
- Example:
-
rm: Removes files or directories.- Example:
rm file.txtdeletes "file.txt."
- Example:
-
cat: Concatenates and displays the contents of files.- Example:
cat file.txtshows the contents of "file.txt."
- Example:
-
man: Displays the manual pages for commands, providing detailed information about their usage.- Example:
man lsshows the manual for thelscommand.
- Example:
These commands form the foundation of working with Unix-like systems. Practicing them will enhance your command-line skills and efficiency. If you want to dive deeper, consider exploring labs on LabEx that focus on command-line basics and file management. Let me know if you have any questions or need further assistance!
