use '*' instead of 'ls'
run `sudo update-rc.d gdm defaults` to get it back
I've got this posted in one of my .bash_profiles for humor whenever I log in. Show Sample Output
I have a directory containing log files. This command delete all but the 5 latest logs. Here is how it works: * The ls -t command list all files with the latest ones at the top * The awk's expression means: for those lines greater than 5, delete.
This command counts the number of blocked NGINX processes every 2 seconds and shows the last 22 measurements You should have at least the number of cpu's in a non-blocked state. The command up to the first ; truncates the log file. Show Sample Output
This command will open tcp port 3000 in your machine
without sed, but has no problems with files with spaces or other critical characters
I have some problems with gnome panel which does not load completely leaving me without the actual GUI. This commands helps to kill the gnome-panel process then it should be relaunch automatically.
Not really an easier solution. But an example using && for (if last command returned 0). You can use || for (if last command returned other than 0).. Show Sample Output
This option is much faster, as it checks only network nodes. Show Sample Output
If you keep saved-webpages to read offline, then deleting the .js files will use a third less disk-space, without affecting the readability.
Command uses find to find and chmod all files recursively.
rkhunter (Rootkit Hunter) is a Unix-based tool that scans for rootkits, backdoors and possible local exploits. rkhunter is a shell script which carries out various checks on the local system to try and detect known rootkits and malware. It also performs checks to see if commands have been modified, if the system startup files have been modified, and various checks on the network interfaces, including checks for listening applications.
this avoids several VIM warnings, which I seem too stupid to disable: warning, readonly! and: file and buffer have changed, reload?!
Choose random file from current folder. Avoids using ls.
display beautiful tree ... "tree dir" display tree from "dir". Show Sample Output
"." is current dir, maxdepth is the level, -print0 | xargs -0 fix spaces in names, -i interactive , ./ is the current dir {} actual name , and {,.bak} is the atual name + bak
Not perfect but working (at least on the project i wrote it ;) ) Specify what you want search in var search, then it grep the folder and show one result at a time. Press enter and then it will show the next result. It can work bad on result in the firsts lines, and it can be improved to allow to come back. But in my case (a large project, i was checking if a value wasn't used withouth is corresponding const and the value is "1000" so there was a lot of result ...) it was perfect ;)
Probably more trouble than its worth, but worked for the obscure need.
"this command line isn't mine but i find it very useful" ^^ This one-liner starts a dedicated server hosting (web server) on port 8000 with the contents of current directory on all the interfaces (address 0.0.0.0), not just localhost. If you have "index.html" or "index.htm" files, it will serve those, otherwise it will list the contents of the currently working directory. It works because python comes with a standard module called SimpleHTTPServer. The -m argument makes python to search for a module named SimpleHTTPServer.py in all the possible system locations (listed in sys.path and $PYTHONPATH shell variable). Once found, it executes it as a script. If you look at the source code of this module, you'll find that this module tests if it's run as a script if __name__ == '__main__', and if it is, it runs the test() method that makes it run a web server in the current directory.
Simple external IP checker, there are many on here but this one works and seems to be the shortest option I can find. Show Sample Output
commandlinefu.com 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.
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.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
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: