Here are some basic Linux commands along with their full forms and brief descriptions:
- ls (List): Lists files and directories in the current working directory. Example: ls -l (long format listing), ls -a (include hidden files), ls -h (human-readable sizes).
- cd (Change Directory): Changes the current working directory. Example: cd /path/to/directory.
- pwd (Print Working Directory): Displays the current working directory. Example: pwd.
- cp (Copy):
Copies files and directories. Example: cp
file.txt destination/.
copy file with same timestamp
cp -p oldfile newfile - mv (Move): Moves or renames files and directories. Example: mv file.txt new_location/, mv old_name.txt new_name.txt.
- rm (Remove): Deletes files and directories. Example: rm file.txt, rm -r directory/ (recursively delete a directory).
- mkdir (Make Directory): Creates a new directory. Example: mkdir new_directory.
- rmdir (Remove Directory): Deletes an empty directory. Example: rmdir empty_directory.
- cat (Concatenate): Displays the contents of a file. Example: cat file.txt.
- more or less: Pager commands to view text files page by page. Example: more file.txt, less file.txt.
- head and tail: Display the first or last part of a file. Example: head file.txt (displays the first few lines), tail file.txt (displays the last few lines).
- grep (Global Regular Expression Print): Searches for a pattern in a file or input. Example: grep "keyword" file.txt.
- find: Searches for files and directories based on different criteria. Example: find /path/to/search -name "filename".
- chmod (Change Mode): Modifies file permissions. Example: chmod +x script.sh (adds execute permission), chmod 644 file.txt (sets read-write permissions for owner, read-only for group and others).
- chown (Change Ownership): Changes the owner of a file or directory. Example: chown user:group file.txt.
- ps (Process Status): Displays information about currently running processes.
Example: ps aux (lists all processes), ps -ef | grep process_name (search for a specific process).
- kill: Sends a signal to terminate a process. Example: kill PID (PID is the process ID).
- df (Disk Free): Shows disk space usage on file systems. Example: df -h ,df -g(displays sizes in human-readable format).
- free: Shows system memory usage. Example: free -h,free-g (displays sizes in human-readable format).
- top and htop: Displays real-time system resource usage and processes. Example: top, htop (htop is an improved version of top).
- ifconfig : Interface Configuration: Displays and configures network interfaces (deprecated on modern systems).
- ip - IP: A modern alternative to ifconfig for network configuration.
- ping : Sends an ICMP echo request to a host to check network connectivity.
- ssh - Secure Shell: Allows secure remote login to another machine over a network.
- scp - Secure Copy: Securely copies files between hosts over a network.
- tar - Tape Archive: Used to archive multiple files into a single tarball file.
- gzip - GNU Zip: Compresses files to reduce their size.
- unzip - Unzip: Extracts files from a zip archive.
- who - Who: Displays a list of currently logged-in users.
- history
- History: Shows a list of previously executed commands.
No comments:
Post a Comment