Welcome to WebmasterWorld Guest from 54.159.52.10

Forum Moderators: bakedjake

Message Too Old, No Replies

Favorite command line tools?

     

littleman

3:48 am on Aug 7, 2003 (gmt 0)

WebmasterWorld Senior Member littleman is a WebmasterWorld Top Contributor of All Time 10+ Year Member



What are your top command line or term based tools and apps?

seindal

9:46 am on Aug 7, 2003 (gmt 0)

10+ Year Member



Mostly the shell itself, with the ability to make complex commands with loops, tests and substitutions.

Mutt the mail reader.

grep for search in log files

tail for monitoring log files

tschild

12:54 pm on Aug 7, 2003 (gmt 0)

10+ Year Member



grep, less, wget

Josk

3:48 pm on Aug 7, 2003 (gmt 0)

10+ Year Member



shutdown?

shutdown -h now

dcheney

3:57 pm on Aug 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



grep, sed, tail

Mohamed_E

5:24 pm on Aug 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



  1. sed for surgery on multiple files
  2. awk to take a colon-separated list and make an HTML table
  3. perl for many other tasks, though I never developed the same familiarity with it as with the older tools

Nick_W

5:31 pm on Aug 7, 2003 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



  • Mutt
  • Lynx

I never got to grips with sed, what's it good for in everyday use?

Nick

bakedjake

5:31 pm on Aug 7, 2003 (gmt 0)

WebmasterWorld Administrator bakedjake is a WebmasterWorld Top Contributor of All Time 10+ Year Member



ssh - for connecting to remote sites

ncftp2 - ncftp is the coolest ftp client on the planet (version 2)

du - for checking disk space of directories

netstat, tcpdump - for debugging network connections

drbrain

5:42 pm on Aug 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You mean that there are non-command line tools?

ruby is my swiss-army knife, and is combined with just about the rest of /bin, /usr/bin, and /usr/local/bin. Every now and then I use something in /sbin, /usr/sbin, /usr/local/sbin, and /usr/X11R6/bin.

Oh, and lets not forget the tools in ~/bin, and ~/.aliases :)

danny

6:41 am on Aug 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ssh, rsync - for connecting to remote machines and maintaining mirrors (I use rsync for my web sites).

mutt, procmail, spamassassin - for email

vi - editing files

perl - one-liners for munging files

python - for longer scripts

Nick_W

6:51 am on Aug 8, 2003 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Which reminds me

Vim!
ncftp
ssh

Nick

seindal

8:08 am on Aug 8, 2003 (gmt 0)

10+ Year Member



All this discussion got me curious, so a ran this on my desktop machine

history ¦ awk '{print $2}' ¦ sort ¦ uniq -c ¦ sort -n

and god this:

484 ls
400 cd
394 perl
288 man
233 less
186 apt-cache
170 mysql
123 locate
119 make
104 dpkg
95 rm
87 grep
71 ps
64 tail
63 jed
63 cvs
57 bc
56 sh
56 mv
45 cat
42 wget
38 host
35 eog
34 xlsatoms
34 mysqldump
34 gcc
33 cp
31 rsync
31 cvs
30 ssh
30 find

As you can see, I do most of my file management in the shell. I never quite got used to graphical file managers, even though I use nautilus regularly.

Besides file management, there's some development work (perl, cvs, man, gcc, make), some server updates (rsync, ssh) and some maintenance (apt-cache, dpkg, mysqldump)

BTW, I keep a history of 5000 commands, hence the high numbers.

David

1:01 pm on Aug 8, 2003 (gmt 0)

10+ Year Member




rpm
up2date
iptables
apt*

panic

7:47 pm on Aug 8, 2003 (gmt 0)

10+ Year Member



killall -9

dcheney

8:10 pm on Aug 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I never got to grips with sed, what's it good for in everyday use?

I use it mostly for transforming text files. For example, one script processes an error log from a major database application. Once grep is done, sed processes the results, turning them into a nice simple html page with the errors in an ordered list.

(sed basically allows you to take "vi" commands, write 'em out in a text file, and use that file to transform whatever file(s) you want.)

moltar

8:17 pm on Aug 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



vi
grep
tail
perl

dingman

8:24 pm on Aug 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



rig (Random Identity Generator)
find
file
lsof
emacs
tail
nohup
ssh
ps
less
links

EliteWeb

8:27 pm on Aug 8, 2003 (gmt 0)

WebmasterWorld Senior Member eliteweb is a WebmasterWorld Top Contributor of All Time 10+ Year Member



nmap
crack
john
tcpdump
lsof

mMmmMmm course those are a mix of binaries and such but still my favorite ;)

kevinpate

8:29 pm on Aug 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For the uneducated amongst us, which may be just me, what is the wget command used for?

I've seen wget sumthinornuther in my logs but dinna really know what it was.

EliteWeb

8:39 pm on Aug 8, 2003 (gmt 0)

WebmasterWorld Senior Member eliteweb is a WebmasterWorld Top Contributor of All Time 10+ Year Member



man wget ;)

GNU Wget is a freely available network utility to retrieve
files from the World Wide Web, using HTTP (Hyper Text
Transfer Protocol) and FTP (File Transfer Protocol), the
two most widely used Internet protocols. It has many use-
ful features to make downloading easier, some of them
being...

panic

10:36 pm on Aug 8, 2003 (gmt 0)

10+ Year Member



Did I mention that command line PHP owns? :)

-panic

Duckula

11:49 am on Aug 9, 2003 (gmt 0)

10+ Year Member



sed basically allows you to take "vi" commands

Actually it's the inverse. In the old times the only way to edit a text file was with ed (not sed), until Billy Joy got sick of dealing with unbuffered lines and devised a VIsual ed :)

Oh, and...

ogg123
dselect
ssh, ssh-add, cvs
make install
locate
My countless bash scripts based on wget

<added>I stand corrected.</added>

Some more:

octave, maxima
python as a calculator
cal, calendar, date
fortune

[edited by: Duckula at 1:20 pm (utc) on Aug. 9, 2003]

seindal

12:18 pm on Aug 9, 2003 (gmt 0)

10+ Year Member



Well, first there was ed, short for editor, with a user interface specially developed for paper terminals. It is still unbeaten in that sector :-)

When the first common teletypes (monochrome text-only monitors common in the 70s and early 80s) appeared, you could programmatically control a viewing area of more than one line, so ex/vi appeared. Ex was little more than a beefed up ed, and vi was the corresponding visual superstructure, the display engine, if you want. You could still run ex in commandline mode, just as ed, if you had to, but running vi on a paper terminal used up a lot of paper :-)

Sed was a variation of ed, and thus independent of ex/vi. Ed was actually rather powerful, especially wrt to search and replace functions, so when the pipe was invented back in the 70s (must have been Unix v4 or v5, because it was definitely there in v6), the ed internals was modified to work as a filter, hence sed, Stream EDitor. Given it was invented for use in pipes, in wonder why they didn't opt for ped, Pipe EDitor, but they didn't.

Grep is also a child of ed. The command in ed for finding and printing lines that match a regular expression is (literally) "g/RE/p" where RE is the Regular Expresssion. Grep is just that part separated from the ed interface. Later the extended grep (egrep) and the fixed string (fgrep) joined the family. Grep was also a part of Unix v6, so it is also from one of the very early version of Unix.

René

MonkeeSage

12:22 pm on Aug 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



df (list all mounted file devices w/ stats)
netstat -a (list all active sockets w/ packet info)
killall -KILL bin (kill the process bin and all its child processes (nb. quick and dirty and may leave zombies in some cases -- -TERM or -HUP is sometimes a better signal choice))
locate string1 [, string2] (search filesystem index for all instances of string string1, ...2, ...3, &c.)
command > something.txt (pipe output of command into file something.txt, creates file first if not exists)

Jordan

jamesa

8:06 pm on Aug 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



whoami (but it never quite gives me the answer I'm looking for :p)

But seriously, in addition to that and others mentioned already:

tail -f <-- great for watching log files in real time
vmstat
top
df
tar
scp
sftp
The whole FreeBSD Ports system!

Panaman

5:54 am on Aug 13, 2003 (gmt 0)

10+ Year Member




r.m -rf /*

reboot

[edited by: littleman at 6:29 pm (utc) on Aug. 13, 2003]
[edit reason] put the dot into save somebody a world of hurt [/edit]

marcs

5:55 am on Aug 13, 2003 (gmt 0)

10+ Year Member



grep, awk, sort, uniq, tail

jamesa

3:15 pm on Aug 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



rm -rf /*

^--- that deletes all the files on your hard disk.

I'm sure that was meant as a joke but I'd hate to see anyone who didn't know better give it a try. Always read the man pages, in this case:

man rm

dingman

3:32 pm on Aug 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Reason number n++ not to run around as root all the time ;)

Of course, for most people all the important stuff is in their home directory and readable/writable by their normal user anyway.

littleman

6:28 pm on Aug 13, 2003 (gmt 0)

WebmasterWorld Senior Member littleman is a WebmasterWorld Top Contributor of All Time 10+ Year Member



My connection was down all last night and I missed that one. Please do not post any damaging code.
This 34 message thread spans 2 pages: 34
 

Featured Threads

Hot Threads This Week

Hot Threads This Month