Linux command line is attractive and fascinating, and there exists a flock of Linux user who are addictive to command Line. Linux command line can be funny and amusing, if you don’t believe me, you can check one of our article below.
As well as extremely powerful, at the same time. We brought to you, five articles on “Lesser Known Linux Commands” consisting of 50+ lesser known Linux command. This article aims at concatenating all those five articles as one, and lets you know, what is where, in brief.
11 Lesser Known Commands – Part I
This article was highly appreciated by our readers, which contains simple yet very important commands. The article summaries as.
- 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.
11 Lesser Known Useful Linux Commands – Part I
The great response, received on this article, and requests to provide another list of ‘Lesser Known Linux Commands‘, from our readers, we wrote next article of the series is:
10 Lesser Known Commands – Part II
This article again was warm welcomed. The summary of the article, below is enough to describe this.
- 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.
10 Lesser Known Linux Commands – Part 2
Getting over 600 Likes on different social Networking sites and many thankful comments, we were ready with our third article of the series is:
10 Lesser Known Commands – Part 3
This article summaries as below:
- 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.
10 Lesser Known Commands for Linux – Part 3
Our Hard-work was paid by the response we received and fourth article of the series was:
10 Lesser Known Linux Commands – Part IV
Need not say, again this article was appreciated. The article summarises below:
- 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.
10 Lesser Known Effective Linux Commands – Part IV
10 Lesser Known Linux Commands- Part V
The commands from here was getting biased towards scripts, yes single line powerful shell scripts and we thought to provide at least one more article on this series.
- 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).
10 Lesser Known Useful Linux Commands- Part V
That’s all for now. Don’t forget to give us your valuable feedback in our comment section. This is not an end of lesser known Linux commands, and we will keep them bringing to you, from time to time, in our articles. I’ll be coming with another article, very interesting and useful for our readers. Till then stay tuned and connected to Tecmint.com.
Hi Everyone,
If you had problem in “loop login” after execute “startx”
use:
thanks tecmint <3 .)
Hello Ravi,
I have Linux server of 64 cores. 32 and 32 core each and connected. Whenever I submit a simulation job for 32 CPUs, so everything is fine. I track its process use. It shows in each line each CPU using 100~99%, and at the 3rd line %CPU=49.5. but when I submit more jobs (previous 32) + 24 CPUs, I guess it goes to the same node, and reduce the performance of the simulation.
I checked using top command. it shows in first 2-3 lines, %CPU=49.5, but there are now 54 CPUs are running with 100~99% utilization. So, my question is that what command should I type to know whether there are 2 nodes or different devices in my Linux server.
When I type the command iostat, it shows following output:
If there are 2 device sda and sdb, then how can I submit job to sdb device, Give your expert opinion.
Python -m SimpleHTTPServer is deprecated and python2 specific
python is normally linked to python3, so you need.
On your `nc -ZV` example, do you rather mean `nc -z` (or possibly `nc -zv`)?
And for Pv — are you referring to pv (aka pipe viewer) or literally Pv?
On bash 4.1.2, I’m not seeing that a space before a bash command omits that command from history. Can you please elaborate on your explanation?
Include this line:
In /etc/profile or write it directly at the command prompt
If the variable HISTCONTROL includes value “ignorespace“, lines which begin with a space character are not saved in the history list.
Change
25. du -h –max-depth=1
to
25. du -h –max-depth=1 Note that -m is not the same as –m. Use two of hex 2D.
@Geoff,
Thanks for pointing out, corrected in the writeup..
Regarding the first command, you can try “sudo!!” a thousand times, it does not work. I looked it up, and it’s “sudo !!” (with a space).
In the bottom page(footer) , there is a line with blue bar “Preparation for the LFCS (Linux Fundation Certified SysAdmin) Exam ” can see that the word “Fundation ” is miss spelled. this is just suggestion
@Shridhar,
Thanks a ton man, yes it was mis spelled and it should “Foundation”, corrected…:)
Holy nice! some really useful and quite a few I don’t know yet. COol :)
Note the `python -m SimpleHTTPServer` needs python2.
found a couple of commands that i’d forgotten about.
hello,
i am new to linux i am having a problem with some of these commands dont work even if i have entered them right please help
@Abhijit,
Could you share with us what problem you facing while executing these commands? some of commands needs to installed before executing them, you can install them using yum or apt package manager tool as per your distribution..
I found this very interesting, along with the other lists on this site. Thanks, for putting them together.
However, I found several typos including misspelled words. If you are interested I will detail them. Here’s a few.
In the first paragraph “Linux user” should be “Linux users”. Down through text commas are used improperly to break up the text.
@Paul,
Thanks for findings, yes if possible can you detail them and send us at [email protected], that would be very great help..
Thank you so much… very useful post
I am getting an error when I run the following:
Command: curl -u gmail_id –silent “https://mail.google.com/mail/feed/atom” | perl -ne ‘print “\t” if //; print “$2\n” if /(.*)/;’
Response: bash: syntax error near unexpected token `(‘
Running Ubuntu 15.04.
Any idea what the problem could be?
Try the following command and don’t forget to add actual email also the quotes needed to be fixed..
curl will need to have SSL enabled.
very good
Dear Edraz dequo,
Very pleased to know you liked the post.
Keep connected for more such posts.
Nice work!
Welcome @ Mark
Hello
It was useful for me ;
Thank you
Welcome @ Hadi
Nice one Avishek!
Very good :)
Thanks.
Thanks for appreciating @ Rodrido.
Good One.
Thanks :)
hi sir
it is one of the best Linux site i have ever seen this is very use full for who want learn Linux
sir i need your help to improve my knowledge on Linux i have done RHCE & RHCSA certifications but i did’t get enough confidence please tell how to prepare for interview and what are concepts are important
i’m not able to configure Local Yum reposotery. Please help.
Thankx Avishek good job!
Welcome @ Ashok Dobal.
Great work Avishek- they are very helpful. I’ve been working on unix for several years but didn’t know some of the above commands
thanks,
Thanks @ MisterNiceGuy,
It was very nice to hear from you.
Hi., im from malaysia & im running fed19,
[root@my-fedora cappingpong]# yum update
Loaded plugins: axelget, fastestmirror, filter-data, keys, langpacks, local,
: priorities, refresh-packagekit, remove-with-leaves, show-leaves
adobe-linux-i386 | 951 B 00:00
fedora/19/i386/metalink | 9.3 kB 00:00
fedora | 4.2 kB 00:00
fedora-HandBrake-source | 2.9 kB 00:00
fedora-chromium-stable | 3.4 kB 00:00
fedora-source/19/i386/metalink | 8.4 kB 00:00
fedora-source | 3.1 kB 00:00
home_darkhado | 1.6 kB 00:00
Could not retrieve mirrorlist http://rpm.livna.org/mirrorlist-debug error was
14: HTTP Error 404 – Not Found
One of the configured repositories failed (Unknown),
and yum doesn’t have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work “fix” this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won’t use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
–enablerepo for temporary usage:
yum-config-manager –disable
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager –save –setopt=.skip_if_unavailable=true
Cannot find a valid baseurl for repo: livna-debuginfo
please help me!!
Remove livna repository using following command and try again update command.
I have been using UNIX for 35 years and I did not know a few of those. Great work. Be careful of the capitalisation though e.g. Touch, Mount etc
Thanks @ Dave Rea, for the nice feedback. Sorry for that capitalization, actually most of the word processor automatically does this. Requesting admin to modify.
good job!
Thanks @ Mike.
Great work!
Thanks @ laike9m, for the great response.