Linux System
Understanding the Basics of Linux Commands
Linux, with its open-source nature, provides a powerful and flexible operating system environment. If you're new to Linux, getting familiar with the basic command-line operations is essential for navigating and managing your system efficiently. In this article, we'll explore some fundamental Linux commands to help you get started.
1. Navigating the File System:
pwd (Print Working Directory): Displays the current working directory.
$ pwd
ls (List): Lists the files and directories in the current directory.
$ ls
cd (Change Directory): Moves to the specified directory.
$ cd /path/to/directory
2. Working with Files and Directories:
touch: Creates an empty file.
$ touch filename.txt
mkdir (Make Directory): Creates a new directory.
$ mkdir new_directory
cp (Copy): Copies files or directories.
$ cp file1.txt /path/to/destination
mv (Move): Moves files or directories.
$ mv file.txt /path/to/destination
rm (Remove): Deletes files or directories.
$ rm file.txt
3. Viewing and Editing Files:
cat (Concatenate): Displays the content of a file.
$ cat filename.txt
less or more: Allows viewing file content page by page.
$ less filename.txt
nano or vim: Text editors for creating or modifying files.
$ nano filename.txt
4. System Information:
uname (Unix Name): Displays system information.
$ uname -a
df (Disk Free): Shows disk space usage.
$ df -h
free: Displays system memory usage.
$ free -h
5. Process Management:
ps (Process Status): Lists currently running processes.
$ ps aux
kill: Terminates a process.
$ kill process_id
top: Provides real-time information about system processes.
$ top
These basic Linux commands serve as a foundation for navigating and managing your system. As you become more comfortable with the command line, you can explore advanced commands and shell scripting to streamline your workflow. Happy Linux command-line exploring!