Commands by ilanehazout (0)

  • bash: commands not found

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Check These Out

Start another X session in a window
You might have Xnest (older) rather than Xephyr. You can experiment with other desktops eg: startx /usr/bin/start-kde -- /usr/bin/Xephyr :2 You can start X on a remote machine (although I'd recommend vnc for anything slower than a LAN): startx /usr/bin/ssh -X gnome-session -- /usr/bin/Xephyr :2 Or just start another X session locally talking to the remote backend:

Upgrading packages. Pacman can update all packages on the system with just one command. This could take quite a while depending on how up-to-date the system is. This command can synchronize the repository databases and update the system's packages.
Warning: Instead of immediately updating as soon as updates are available, users must recognize that due to the nature of Arch's rolling release approach, an update may have unforeseen consequences. This means that it is not wise to update if, for example, one is about to deliver an important presentation. Rather, update during free time and be prepared to deal with any problems that may arise. Pacman is a powerful package management tool, but it does not attempt to handle all corner cases. Read The Arch Way if this causes confusion. Users must be vigilant and take responsibility for maintaining their own system. When performing a system update, it is essential that users read all information output by pacman and use common sense. If a user-modified configuration file needs to be upgraded for a new version of a package, a .pacnew file will be created to avoid overwriting settings modified by the user. Pacman will prompt the user to merge them. These files require manual intervention from the user and it is good practice to handle them right after every package upgrade or removal. See Pacnew and Pacsave Files for more info. Tip: Remember that pacman's output is logged in /var/log/pacman.log.

Find the package that installed a command

Quickly generate an MD5 hash for a text string using OpenSSL

Restrict the use of dmesg for current user/session
Linux offers an interesting option to restrict the use of dmesg. It is available via /proc/sys/kernel/dmesg_restrict. You can check the status with: $ cat /proc/sys/kernel/dmesg_restrict Alternatively you can use sysctl: $ sudo sysctl -w kernel.dmesg_restrict=1 To make your change persistent across reboot, edit a fille in /etc/sysctl.d/.

sendEmail - easiest commandline way to send e-mail

Launch firefox on a remote linux server
Actually 'firefox' is a script that then launches the 'firefox-bin' executable. You need to specify the 'no-remote' option in order to launch remote firefox instead of your local one (this drove me crazy time ago)

Alert visually until any key is pressed
I learned a few things reading this command. But I did run into a few issues: 1. On systems that don't use GNU echo (e.g. macOS 10.14.5 Mojave), the e option may not be supported. In this case ANSI escape codes will echoed as text and the terminal will not flash, like this: \e[?5h\e[38;5;1m A L E R T Thu Jun 20 16:31:29 PDT 2019 2. Since the read command strips\ignores leading backslashes, if a user types the backslash character once in the loop, it will not break. Typing backslash twice in a loop will break as expected. 3. The foreground color is set to red (\e[38;5;1m) on every loop. This could be set once before we call while, and then reset once when the loop breaks. 4. Instead of resetting the foreground color when it breaks, the video mode is set back to normal (\e[?5l). This has the effect of leaving the terminal text red until it is manually reset. The alternative I'm proposing here addresses these issues. I tested it on macOS and Arch Linux.

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Pull up remote desktop for other than gnome/kde eg fluxbox
If the remote doesn't export its desktop (eg fluxbox, blackbox etc) then you need to run a x11vnc server there and a vncviewer at the local end. This command does the lot for you - it assumes that you can 'ssh' to the box without a password and that x11vnc is installed at the remote end.

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: