commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
I use this with alias:
alias lsl="ls -1F | grep @ | sed 's/@//' | column"
grep по ps aux
Goto phase 2 to clobber the interrupt that is problematic.
Deprecated due to a change in the site design: see alternatives.
Do the unlock KDE screen saver locked session with lightdm display manager used in Kubuntu 12.10 +
Translate strings from non-german to german (and vice versa) using LEO. Put it in your ~/.bashrc.
To support languages other than english, change the lang variable:
lang=ch # chinese
lang=en # english
lang=es # spanish
lang=fr # french
lang=it # italian
lang=pl # polish
lang=pt # portuguese
lang=ru # russian
The other language will always be german!
This will catch most separators in the section of the email:
plus + (added for gmail)
... and the basic dash '-' of host names.
This command will help you to get Ip address origin of city and country.
I will be happy if someone can shrink the sed command
This has saved me many times while debugging timeout issues to "too many open files" issues. A high number of the order of thousand, indicates that somewhere connection is not being closed properly.
Required : information_schema
** Only replace the "DB-NAME" and "PREFIX" with your DB-name and wildcard prefix match.
** Also replace with your own username and password for mysql server.
This command uses the information_schema to wildcard match tables that we donot need from a database and than pipes the remaining tables out through "xargs" command to the mysqldump utility which than dumps those remaining tables into a sql dump file.
Count your source and header file's line numbers. This ignores blank lines, C++ style comments, single line C style comments.
This will not ignore blank lines with tabs or multiline C style comments.
Counts of messages by recipient, with frozen messages excluded.
Inner "ps...grep..." command searches for a process matching the specified .
"lsof -p lists all file descriptors owned by . Includes open files, sockets, devices, etc...
The -a option in -aEio tells grep to treat binary files as text files.
I don't like doing a massive sort on all the directory names just to get a small set of them. the above shows a sorted list of all directories over 1GB. use head as well if you want.
du's "-x" flag limits this to one file system. That's mostly useful when you run it on "/" but don't want "/proc" and "/dev" and so forth. Remember though that it will also exclude "/home" or "/var" if those are separate partitions.
the "-a" option is often useful too, for listing large files as well as large directories. Might be slower.
This command is useful for searching through a whole folder worth of pdf files.
I use this one-liner to search my sourcecode to find out where tags are named and since there's no easy way in XCode to see what values have already been used.