Introduction:
In this blog post, we will explore some of the basic Linux commands that every beginner should know. These commands will help you navigate through the file system, list files and directories, and perform common directory operations. Let's dive in! ๐โโ๏ธ๐ก
File Operations ๐
ls
: List files and directories in the present working directory.ls -R
: List files in sub-directories as well.ls -a
: Show hidden files.ls -al
: List files and directories with detailed information.cd <directoryname>
: Change to a specific directory.cd ..
: Move one level up.pwd
: Display the present working directory.cat > filename
: Create a new file.cat filename
: Display the file content.touch filename
: Create or modify a file.rm filename
: Delete a file.cp source destination
: Copy files from the source path to the destination path.mv source destination
: Move files from the source path to the destination path.find / -name filename
: Find a file or directory by its name.file filename
: Determine the file type.less filename
: View file content page by page.head filename
: View the first ten lines of a file.tail filename
: View the last ten lines of a file.lsof
: Show which files are opened by which process.du -h --max-depth=1
: Show the size of each directory.
Directory Operations ๐
mkdir directoryname
: Create a new directory in the present working directory.rmdir directoryname
: Delete a directory.cp -r source destination
: Copy directories recursively.mv olddir newdir
: Rename directories.find / -type d -name directoryname
: Find a directory starting from the root.
Process Operations ๐
ps
: Display currently active processes.top
: Display all running processes.kill pid
: Terminate a process with the given process ID.pkill name
: Terminate a process with the given name.bg
: Resume suspended jobs without bringing them to the foreground.fg
: Bring the most recent job to the foreground.fg n
: Bring job n to the foreground.renice +n [pid]
: Change the priority of a running process.
File Permissions ๐
chmod octal filename
: Change the permissions of a file.chown ownername filename
: Change the file owner.chgrp groupname filename
: Change the group owner.
These commands will give you a solid foundation to work with files, directories, processes, and permissions in Linux. Practice and explore more to become a Linux command-line expert! ๐ช
This is just the tip of the iceberg when it comes to Linux commands. Feel free to dive deeper and discover more commands that suit your needs. Happy Linux command-line journey! ๐ง๐ป
Hope you like my blog...!
if u like the content follow me on LinkedIn: https://www.linkedin.com/in/ashok-sana
Follow my Whatsapp & telegram community: https://chat.whatsapp.com/BzX1aruZIH645l29LxvgO3
Happy learning......!