Basic Linux Commands
1. Navigating the File System
-
pwd
: Print Working Directory. This command displays the current directory. cd
: Change Directory. Navigate between directories.- Usage:
cd [directory_name]
. - For example,
cd /home/user/Documents
will navigate to the Documents directory.
- Usage:
ls
: List. This command lists files and directories in the current directory.- Use
ls -l
for a detailed list, orls -a
to see hidden files.
- Use
You can learn more about navigating the Linux file system here.
2. File Operations
touch
: Create a new empty file.- Usage:
touch [file_name]
.
- Usage:
cp
: Copy. Copy files or directories.- Usage:
cp [source_file] [destination_directory]
.
- Usage:
mv
: Move. Move or rename files or directories.- Usage:
mv [source_file] [destination_directory]
.
- Usage:
rm
: Remove. Delete files or directories.- Usage:
rm [file_name]
.
- Usage:
More details about file operations can be found here.
3. Permissions
chmod
: Change Mode. Change the permissions of a file or directory.- Usage:
chmod [permissions] [file_name]
.
- Usage:
Read more about permissions here.
4. Process Management
-
ps
: Process Status. Show running processes. -
top
: Display an ongoing, updated list of running processes. -
kill
: Terminate a process.- Usage:
kill [process_id]
.
- Usage:
You can find more information about process management here.
5. System Information
-
uname
: Display system information. -
df
: Disk Free. Show disk usage. -
free
: Show memory usage.
Check out this link for more system information commands.
Remember, to learn more about any command, you can use the man
command, which stands for “manual”. For example, man ls
will show you the manual for the ls
command.
Please note that many of these commands will require you to have appropriate permissions in your Linux system to run. Be cautious when using commands that modify files or processes, especially when running commands as the root user.
This guide should help you get started with basic Linux command line operations. As you become more comfortable, you can explore more complex commands and procedures. Happy learning!