Skip to main content

Basic but lesser known Linux Commands


For Debian/Ubuntu-

  • 1. sudo!! : Forgot to run a command with sudo? You need not re-write the whole command, just type “sudo!!” and the last command will run with sudo.
  • 2. Python -m SimpleHTTPServer : Creates a simple web page for the current working directory over port 8000.
  • 3. mtr : A command which is a combination of ‘ping’ and ‘traceroute’ command.
  • 4. Ctrl+x+e : This key combination fires up, an editor in the terminal, instantaneously.
  • 5. nl : Outputs the content of text file with lines Numbered.
  • 6. shuf : Randomly selects line/file/folder from a file/folder.
  • 7. ss : Outputs Socket Statistics.
  • 8. Last: Want to know history of last logged in users? This command comes to rescue here.
  • 9. curl ifconfig.me : Shows machine’s external IP Address.
  • 10. tree : Prints files and folders in tree like fashion, recursively.
  • 11. Pstree : Prints running processes with child processes, recursively.
  • 12. <space> command : A space before a bash command, is not recorded in history.
  • 13. stat : Shows the status information of a file as well as of a file system.
  • 14. <alt>. And <esc>. : A tweak which put the last command argument at prompt, in the order of last entered command, appearing first.
  • 15. Pv : outputs simulating text, similar to hollywood movies.
  • 16. Mount | column -t : Lists mounted file system, in nice formatting with specification.
  • 17. Ctrl + l: clear shell prompt, instantaneously.
  • 18. curl -u gmail_id –silent “https://mail.google.com/mail/feed/atom” | perl -ne ‘print “\t” if //; print “$2\n” if /(.*)/;’. This simple scripts, opens up, unread mail of an user, in the terminal itself.
  • 19. screen : Detach and Reattach, long running process from a session.
  • 20. file : Outputs information, regarding types of file.
  • 21. id : Print User and Group Id.
  • 22. ^foo^bar : Run last command with modification, without the need of rewriting the whole command again.
  • 23. > file.txt : Flush the content of a text file, in a single go, from the command prompt.
  • 24. at : Run a particular command, time based.
  • 25. du -h –max-depth=1 Command : Outputs the size of all the files and folders within current folder, in human readable format.
  • 26. expr : Solve simple mathematical calculations from the terminal.
  • 27. look: Check for an English word, from the dictionary, in case of confusion, right from the shell.
  • 28. yes : continues to print a sting, till interrupt instruction is given.
  • 29. factor: Gives all the possible factors of a decimal number.
  • 30. ping -i 60 -a IP_address : Pings the provided IP_address, and gives audible sound when host comes alive.
  • 31. tac : Prints content of a file, in reverse order.
  • 32. strace : A debugging tool.
  • 33. disown -a && exit Command : Run a command in background, even after terminal session is closed.
  • 34. getconf LONG_BIT Command : Output Machine Architecture, very clearly.
  • 35. while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-29));date;tput rc;done & : The script outputs date and time on the top right corner of shell/ terminal.
  • 36. convert : converts the output of a command in picture, automatically.
  • 37. watch -t -n1 “date +%T|figlet” : Show animated digital clock at the prompt.
  • 38. host and dig : DNS lookup utility.
  • 39. dstat : Generates statistics regarding system resource.
  • 40. bind -p : Shows all the shortcuts available in Bash.
  • 41. Touch /forcefsck : Force file-system check on next boot.
  • 42. lsb_release : Prints distribution specification information.
  • 43. nc -ZV localhost port_number : Check if a specific port is open or not.
  • 44. curl ipinfo.io : Outputs Geographical Information, regarding an ip_address.
  • 45. find .-user xyz : Lists all file owned by user ‘xyz’
  • 46. apt-get build-dep package_name: Build all the dependency, automatically while installing any specific package.
  • 47. lsof -iTCP:80 -sTCP:LISTEN. The script, outputs all the service/process using port 80.
  • 48. find -size +100M : This command combination, Lists all the files/folders the size of which is 100M or more.
  • 49. pdftk : A nice way to concatenate a lot of pdf files, into one.
  • 50. ps -LF -u user_name : Outputs Processes and Threads of a user.
  • 51. Startx — :1 (This command creates another new X session).
  • 52. Open a file in its default format :       xdg-open <file name>
  • 53. After installing Googler, google on Linux Terminal :   googler <topic>
  • 54. To open a website on Terminal - install w3m or lynx then : w3m <url>  or  lynx <url>

Comments

Popular posts from this blog

Integrate AWS CloudFront with S3 bucket

Amazon CloudFront and Other Amazon Web Services:  Amazon CloudFront : CloudFront can be used to deliver your entire website or application, including dynamic, static, streaming, and interactive content, using a global network of edge locations. Amazon CloudFront works well with other Amazon Web Services. You can easily use an Amazon S3 bucket, an Amazon EC2 instance, an Amazon Elastic Load Balancing load balancer, or your own web server as the origin. In this tutorial, we will use Amazon S3 as the origin. Step 1: Prepare Your Content To deliver content to end users with a web distribution, you need to prepare content.  Amazon CloudFront distributes many types of content, including images, videos, HTML pages, .css files, and .php files.  In this step, we will upload sample content to the cloud using Amazon S3. a. The sample image we will use in this tutorial is a PNG image called cloudfront-test-image.png .  Click the b...

Basic Introduction about AWS Services

EC2 Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment. RDS Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while managing time-consuming database administration tasks, freeing you up to focus on your applications and business.  Amazon RDS provides you six familiar database engines to choose from, including Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle, and Microsoft SQL Server. S3 Amazon Simple Storage Service (Amazon S3) is object storage with a simple web servi...