Usage: flight_status airline_code flight_number (optional)_offset_of_departure_date_from_today So for instance, to track a flight which departed yesterday, the optional 3rd parameter should have a value of -1. eg. flight_status ua 3655 -1 output --------- Status: Arrived Departure: San Francisco, CA (SFO) Scheduled: 6:30 AM, Jan 3 Takeoff: 7:18 AM, Jan 3 Term-Gate: Term 1 - 32A Arrival: Newark, NJ (EWR) Scheduled: 2:55 PM, Jan 3 At Gate: 3:42 PM, Jan 3 Term-Gate: Term C - C131 Note: html2text needs to be installed for this command. only tested on ubuntu 9.10 Show Sample Output
Tested in Linux and OSX Show Sample Output
If you are already running screen then you often want to start a command in a fresh window. You use this alias by typing 's whatever' from your command line and 'whatever' starts running in a new window. Good with interactive commands like info, vim, and nethack.
Particularly useful on OS X where netstat doesn't have -p option. Show Sample Output
This command finds and prints all the symbolic and hard links to a file. Note that the file argument itself be a link and it will find the original file as well.
You can also do this with the inode number for a file or directory by first using stat or ls or some other tool to get the number like so:
stat -Lc %i file
or
ls -Hid file
And then using:
find -L / -inum INODE_NUMBER -exec ls -ld {} +
shorter than alternative
If your last command was a dud, your bash prompt will be angry at you. Otherwise it's happy. Soon you will crave its constant approval and your linux skills will improve simply to avoid low self-esteem. Show Sample Output
I have come across a situation in the past where someone has unlinked a file by running an 'rm' command against it while it was still being written to by a running process.
The problem manifested itself when a 'df' command showed a filesystem at 100%, but this did not match the total value of a 'du -sk *'.
When this happens, the process continues to write to the file but you can no longer see the file on the filesystem. Stopping and starting the process will, more often than not, get rid of the unlinked file, however this is not always possible on a live server.
When you are in this situation you can use the 'lsof' command above to get the PID of the process that owns the file (in the sample output this is 23521).
Run the following command to see a sym-link to the file (marked as deleted):
cd /proc/23521/fd && ls -l
Truncate the sym-link to regain your disk space:
> /proc/23521/fd/3
I should point out that this is pretty brutal and *could* potentially destabilise your system depending on what process the file belongs to that you are truncating.
Show Sample Output
View all files opened by a user in specified directory. The +D option makes lsof search all sub-directories to complete depth, while ignoring symbolic links.
This is a very simple and lightweight way to play DI.FM stations
For a more complete version of the command with proper strings in the menu, try: (couldnt fit in the command field above)
zenity --list --width 500 --height 500 --title 'DI.FM' --text 'Pick a Radio' --column 'radio' --column 'url' --print-column 2 $(curl -s http://www.di.fm/ | awk -F '"' '/href="http:.*\.pls.*96k/ {print $2}' | sort | awk -F '/|\.' '{print $(NF-1) " " $0}') | xargs mplayer
This command line parses the html returned from http://di.fm and display all radio stations in a nice graphical menu. After the radio is chosen, the url is passed to mplayer so the music can start
dependencies:
- x11 with gtk environment
- zenity: simple app for displaying gtk menus (sudo apt-get install zenity on ubuntu)
- mplayer: simple audio player (sudo apt-get install mplayer on ubuntu)
Show Sample Output
The "-r 2" option puts lsof in repeat mode, with updates every 2 seconds. (Ctrl -c quits) The "-p" option is used to specify the application PID you want to monitor. The "-u' option can be used to keep an eye on a users network activity. "lsof -r 2 -u username -i -a"
I'm working in a group project currently and annoyed at the lack of output by my teammates. Wanting hard metrics of how awesome I am and how awesome they aren't, I wrote this command up. It will print a full repository listing of all files, remove the directories which confuse blame, run svn blame on each individual file, and tally the resulting line counts. It seems quite slow, depending on your repository location, because blame must hit the server for each individual file. You can remove the -R on the first part to print out the tallies for just the current directory. Show Sample Output
The URL can then be pasted with a middle click. This is probably useful when trying to explain problems over instant messaging when you don't have some sort of shared desktop.
List the files a process is using.
parse "lsmod" output to "dot" format and pass it to "display". Without perl!
You can convert any UNIX man page to .txt
this leaves the cursor at the bottom of the terminal screen, where your eyes are. ctrl-l moves it to the top, forcing you to look up.
Plot your most used commands with gnuplot.
Ever since the switch to pulseaudio, Ubuntu users including myself have found themselves with no sound intermittently. To fix this, just use this command and restarts firefox or mplayer or whatever.
It may be helpful in case you need to umount a directory and some process is preventing you to do so keeping the folder busy. The lsof may process the +D option slowly and may require a significant amount of memory because it will descend the full dir tree. On the other hand it will neither follow symlinks nor other file systems.
Commandlinefu.com is great but has a few bugs when people are submitting new commands:
.
1. There is no preview button. This was a minor inconvenience before, but now is a major problem since new commands won't show up to be edited until they have been moderated.
.
2. White space in the description field and in the comments is almost completely lost. People resort to using periods in between paragraphs to force a line break. Indentation of code is ridiculous.
.
3. Many characters get munged.
.
3a. For example, a less than character in the description gets read as an HTML tag and discarded. In order to type a less than, I've had to type "<" (I hope that comes out right). Unfortunately, when re-editing a command, the HTML entity is turned into a literal less than character, which I have to change back by hand before saving.
3b. Some unicode characters work in the description field, but turn into ugly literal HTML strings when put in the sample output or in an additional command using the $ prefix.
.
For example, here is a unicode character: ❥
Here is the same character after a dollar sign: ❥
.
3c. Some unicode characters don't work anywhere. Bizarrely, it appears to be the most commonly needed ones, such as Latin-1 accented characters. Here are some examples,
.
Bullet: ?, Center dot: ?, Umlaut u: ?.
.
4. Here is an example of the greater than, >, and less than,
.
5. Commandlinefu used to abbreviate long descriptions on the front page and had a "more..." button so that people could read the rest if they wanted. That's a good feature as it encourages people to explain their commands more fully. Either, the feature has gone missing, or, perhaps, I was just hallucinating it existed in the first place. If the former, please bring it back, If the latter, please implement this great new feature I just thought up.
.
6. Tags cannot include Unicode characters. If you try to type one in, the cursor will just spin and spin as it attempt to look up if that tag exists already. For example, try typing Ctrl+Shift+u 2 7 6 5 SPC as a tag name.
Show Sample Output
I prefer to use this and not the -n variety, so I get DNS-resolved hostnames. Nice when I'm trying to figure out who's got that port open.
Merge all pdf files in the directory into one pdf file (the out.pdf file)
That is useful to discover the start time of process older than 1 day.
You can also run:
ls -ld /proc/PID
That's returning the creation date of the proc files from the process. Some users reported that this way might show you a wrong date since any other process like cron, for example, could change this date.
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: