LINUX BASIC COMMANDS
LINUX BASIC COMMANDS:
- pwd: Print the current working directory.
bash
· pwd
· ls: List files and directories.
bash
· ls
Additional options:
- ls -l: Long listing format.
- ls -a: List all files, including hidden ones.
- ls -lh: Human-readable file sizes.
· cd: Change directory.
bash
· cd directory_name
· mkdir: Create a new directory.
arduino
· mkdir new_directory
· cp: Copy files or directories.
bash
· cp source_file destination
Additional options:
- cp -r: Copy directories recursively.
- cp -i: Prompt before overwriting.
· mv: Move or rename files or directories.
bash
mv old_file new_location
Renaming:
bash
· mv old_file new_file
· rm: Remove/delete files or directories.
bash
· rm file_name
Additional options:
- rm -r: Remove directories and their contents recursively.
- rm -f: Force removal without confirmation.
· touch: Create an empty file or update the access/modification time of a file.
bash
· touch file_name
· cat: Concatenate and display the content of files.
bash
· cat file_name
· more and less: Display the contents of a file one screen at a time.
· more file_name
less file_name
· head and tail: Display the first/last few lines of a file.
bash
· head file_name
tail file_name
· chmod: Change file permissions.
bash
chmod permissions file_name
Example:
bash
· chmod +x script.sh
· chown: Change file owner and group.
sql
· chown user:group file_name
· ps: Display information about running processes.
· ps aux
· kill: Terminate a process.
bash
15.kill process_id
These are just a few basic commands. There are many more commands and options available in Linux. You can explore further by checking the manual pages using the man command. For example:
bash
man ls
Comments
Post a Comment