{"id":883,"date":"2023-12-25T22:46:52","date_gmt":"2023-12-25T22:46:52","guid":{"rendered":"https:\/\/www.sandykadam.com\/blog\/?p=883"},"modified":"2023-12-25T22:59:56","modified_gmt":"2023-12-25T22:59:56","slug":"essential-linux-commands-every-developer-should-master","status":"publish","type":"post","link":"https:\/\/www.sandykadam.com\/blog\/technology\/essential-linux-commands-every-developer-should-master\/","title":{"rendered":"Essential Linux commands every developer should master"},"content":{"rendered":"\n<p><code>ls<\/code> &#8211; List Files and Directories: List the contents of a directory.<br \/>Example: <code>ls -l<\/code><\/p>\n\n\n\n<p><code>cd<\/code> &#8211; Change Directory: Navigate to a different directory.<br \/>Example: <code>cd \/home\/user\/documents<\/code><\/p>\n\n\n\n<p><code>pwd<\/code> &#8211; Print Working Directory: Display the current directory&#8217;s full path. <br \/>Example: <code>pwd<\/code><\/p>\n\n\n\n<p><code>mkdir<\/code> &#8211; Make Directory: Create a new directory.<br \/>Example: <code>mkdir your_folder_name<\/code><\/p>\n\n\n\n<p><code>rm<\/code> &#8211; Remove: Delete files or directory.<br \/>Example: <code>rm yourfile.txt<\/code><\/p>\n\n\n\n<p><code>cp<\/code> &#8211; Copy: Copy files or directories.<br \/>Example: <code>cp file.txt \/destination_folder<\/code><\/p>\n\n\n\n<p><code>mv<\/code> &#8211; Move: Move files or directories.<br \/>Example: <code>mv file.txt \/your_new_location<\/code><\/p>\n\n\n\n<p><code>touch<\/code> &#8211; Create Empty File: Create a new empty file.<br \/>Example: <code>touch new_file.txt<\/code><\/p>\n\n\n\n<p><code>cat<\/code> &#8211; Concatenate and Display: View the content of a file.<br \/>Example: <code>cat file.txt<\/code><\/p>\n\n\n\n<p><code>nano<\/code> &#8211; Text Editor: Open a text file for editing.<br \/>Example: <code>nano file.txt<\/code><\/p>\n\n\n\n<p><code>grep<\/code> &#8211; Search Text: Search for text patterns in files.<br \/>Example: <code>grep \"pattern\" file.txt<\/code><\/p>\n\n\n\n<p><code>find<\/code> &#8211; Search Files and Directories: Search for files and directories. <br \/>Example: <code>find \/path\/to\/search -name \"file_name\"<\/code><\/p>\n\n\n\n<p><code>chmod<\/code> &#8211; Change File Permissions: Modify file permissions.<br \/>Example: <code>chmod 755 file.sh<\/code><\/p>\n\n\n\n<p><code>chown<\/code> &#8211; Change Ownership: Change the owner and group of a file or directory.<br \/>Example: <code>chown user:group file.txt<\/code><\/p>\n\n\n\n<p><code>ps<\/code> &#8211; Process Status: Display running processes.<br \/>Example: <code>ps aux<\/code><\/p>\n\n\n\n<p><code>top<\/code> &#8211; Monitor System Activity: Monitor system processes in real-time. <br \/>Example: <code>top<\/code><\/p>\n\n\n\n<p><code>kill<\/code> &#8211; Terminate Processes: Terminate a process using its ID.<br \/>Example: <code>kill PID<\/code><\/p>\n\n\n\n<p><code>wget<\/code> &#8211; Download Files: Download files from the internet.<br \/>Example: <code>wget <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/example.com\/file.zip');\"  href=\"https:\/\/example.com\/file.zip\">https:\/\/example.com\/file.zip<\/a><\/code><\/p>\n\n\n\n<p><code>curl<\/code> &#8211; Transfer Data with URLs: Transfer data to or from a server. <br \/>Example: <code>curl -O <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/example.com\/file.txt');\"  href=\"https:\/\/example.com\/file.txt\">https:\/\/example.com\/file.txt<\/a><\/code><\/p>\n\n\n\n<p><code>tar<\/code> &#8211; Archive and Extract: Create or extract compressed archive files. <br \/>Example: <code>tar -czvf archive.tar.gz folder<\/code><\/p>\n\n\n\n<p><code>ssh<\/code> &#8211; Secure Shell: Connect to a remote server securely.<br \/>Example: <code>ssh user@remote_host<\/code><\/p>\n\n\n\n<p><code>scp<\/code> &#8211; Securely Copy Files: Copy files between local and remote systems using SSH.<br \/>Example: <code>scp file.txt user@remote_host:\/path<\/code><\/p>\n\n\n\n<p><code>rsync<\/code> &#8211; Remote Sync: Synchronize files and directories between systems.<br \/>Example: <code>rsync -avz local_folder\/ user@remote_host:remote_folder\/<\/code><\/p>\n\n\n\n<p><code>df<\/code> &#8211; Disk Free Space: Display disk space usage.<br \/>Example: <code>df -h<\/code><\/p>\n\n\n\n<p><code>du<\/code> &#8211; Disk Usage: Show the size of files and directories.<br \/>Example: <code>du -sh \/path\/to\/directory<\/code><\/p>\n\n\n\n<p><code>ifconfig<\/code> &#8211; Network Configuration: Display or configure network interfaces (deprecated, use ip).<br \/>Example: <code>ifconfig<\/code><\/p>\n\n\n\n<p><code>ip<\/code> &#8211; IP Configuration: Manage IP addresses and network settings. <br \/>Example: <code>ip addr show<\/code><\/p>\n\n\n\n<p><code>netstat<\/code> &#8211; Network Statistics: Display network connections and statistics (deprecated, use ss).<br \/>Example: <code>netstat -tuln<\/code><\/p>\n\n\n\n<p><code>systemctl<\/code> &#8211; System Control: Manage system services using systems. <br \/>Example: <code>systemctl start service_name<\/code><\/p>\n\n\n\n<p><code>journalctl<\/code> &#8211; Systemd Journal: View system logs using systemd&#8217;s journal.<br \/>Example: <code>journalctl -u service_name<\/code><\/p>\n\n\n\n<p><code>cron<\/code> &#8211; Schedule Tasks: Manage scheduled tasks.<br \/>Example: <code>crontab -e<\/code><\/p>\n\n\n\n<p><code>at<\/code> &#8211; Execute Commands Later: Run commands at a specified time. <br \/>Example: <code>echo \"command\" | at 15:30<\/code><\/p>\n\n\n\n<p><code>ping<\/code> &#8211; Network Connectivity: Check network connectivity to a host. <br \/>Example: <code>ping google.com<\/code><\/p>\n\n\n\n<p><code>traceroute<\/code> &#8211; Trace Route: Trace the route packets take to reach a host. <br \/>Example: <code>traceroute google.com<\/code><\/p>\n\n\n\n<p><code>curl<\/code> &#8211; Check Website Connectivity: Check if a website is up.<br \/>Example: <code>curl -Is https:\/\/example.com | head -n 1<\/code><\/p>\n\n\n\n<p><code>dig<\/code> &#8211; Domain Information Groper: Retrieve DNS information for a domain.<br \/>Example: <code>dig example.com<\/code><\/p>\n\n\n\n<p><code>hostname<\/code> &#8211; Display or Set Hostname: Display or change the system&#8217;s hostname.<br \/>Example: <code>hostname<\/code><\/p>\n\n\n\n<p><code>who<\/code> &#8211; Display Users: Display currently logged-in users.<br \/>Example: <code>who<\/code><\/p>\n\n\n\n<p><code>useradd<\/code> &#8211; Add User: Create a new user account.<br \/>Example: <code>useradd newuser<\/code><\/p>\n\n\n\n<p><code>usermod<\/code> &#8211; Modify User: Modify user account properties.<br \/>Example: <code>usermod -aG groupname username<\/code><\/p>\n\n\n\n<p><code>passwd<\/code> &#8211; Change Password: Change user password.<br \/>Example: <code>passwd username<\/code><\/p>\n\n\n\n<p><code>sudo<\/code> &#8211; Superuser Do: Execute commands as the superuser.<br \/>Example: <code>sudo command<\/code><\/p>\n\n\n\n<p><code>lsof<\/code> &#8211; List Open Files: List open files and processes using them. <br \/>Example: <code>lsof -i :port<\/code><\/p>\n\n\n\n<p><code>nc<\/code> &#8211; Netcat: Networking utility to read and write data across network connections.<br \/>Example: <code>echo \"Hello\" | nc host port<\/code><\/p>\n\n\n\n<p><code>scp<\/code> &#8211; Secure Copy Between Hosts: Copy files securely between hosts. <br \/>Example: <code>scp file.txt user@remote_host:\/path<\/code><\/p>\n\n\n\n<p><code>sed<\/code> &#8211; Stream Editor: Text manipulation using regex.<br \/>Example: <code>sed 's\/old\/new\/g' file.txt<\/code><\/p>\n\n\n\n<p><code>awk<\/code> &#8211; Text Processing: Pattern scanning and text processing.<br \/>Example: <code>awk '{print $2}' file.txt<\/code><\/p>\n\n\n\n<p><code>cut<\/code> &#8211; Text Column Extraction: Extract specific columns from text. <br \/>Example:<code> cut -d\",\" -f2 file.csv<\/code><\/p>\n\n\n\n<p><code>sort<\/code> &#8211; Sort Lines: Sort lines of text files.<br \/>Example: <code>sort file.txt<\/code><br \/><br \/><code>diff<\/code> &#8211; File Comparison: Compare two files and show differences. <br \/>Example: <code>diff file1.txt file2.txt<\/code><br \/><br \/><code>wc<\/code> &#8211; Count the word characters<br \/>Example: <code>wc -l<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Explore crucial Linux commands that developers rely on daily for efficient and effective workflow. Master these essentials to enhance your proficiency in Linux development.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[129,12],"tags":[128,124,127,126,123,125],"class_list":["post-883","post","type-post","status-publish","format-standard","hentry","category-devops","category-technology","tag-commands","tag-developer","tag-essential","tag-linux","tag-linux-commands","tag-master"],"aioseo_notices":[],"views":514,"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p25uYH-ef","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sandykadam.com\/blog\/wp-json\/wp\/v2\/posts\/883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sandykadam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sandykadam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sandykadam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sandykadam.com\/blog\/wp-json\/wp\/v2\/comments?post=883"}],"version-history":[{"count":2,"href":"https:\/\/www.sandykadam.com\/blog\/wp-json\/wp\/v2\/posts\/883\/revisions"}],"predecessor-version":[{"id":886,"href":"https:\/\/www.sandykadam.com\/blog\/wp-json\/wp\/v2\/posts\/883\/revisions\/886"}],"wp:attachment":[{"href":"https:\/\/www.sandykadam.com\/blog\/wp-json\/wp\/v2\/media?parent=883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sandykadam.com\/blog\/wp-json\/wp\/v2\/categories?post=883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sandykadam.com\/blog\/wp-json\/wp\/v2\/tags?post=883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}