|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 - 3 | Next > |
|
|
Command of the HourOk, I want to start a bit of a discussion here - I want everyone to
chime in and tell the list of any random, obscure and useful commands they know of. Anything you have come across that has helped you in some way or you thought would be really handy in some situation, doesn't matter what. I'll start the ball rolling with several top variants: atop - I just had an issue where gnome wasn't logging in, but seemed to be stuck constantly accessing the hard drive. This command saved me by showing me exactly which program was using the hard drive and a quick aptitude remove mlocate later my system was working perfectly again. It monitors CPU, memory, disk and network highlighting any that are particularly stressed and shows the processes responsible. Processes are only displayed if they have done something interesting since the last update. Kernel patches can be taken to enhance the experience if one is so inclined. htop - Awesome ncurses graphical top. Looks pretty, coloured, and simply highlighting a process and pressing 'S' will attach strace to it to see what that run away process is actually up to. Tag multiple processes and alter the niceness of them all at once or just kill em' all. 'T' toggles between process tree view and ordinary top view. powertop - I'm sure lots of people know about this one by now, but for anyone who doesn't it can show you various information about what is chewing up energy in your system and provide some recommendations for conserving power. iftop - top for network traffic. Shows the traffic going to and fro on every individual transfer and totalled down the bottom in ncurses bar graph style. Amounts are displayed for the last 2, 10 and 40 seconds. Filters can be applied if one is only interested in a subset of the total traffic, and it can naturally do hostname lookups and show port numbers/service names. ntop - another network top, but this one starts a web server on port 3000 to display it's results with pretty graphs. It has the advantage that it provides much more detail - it breaks packets down by size, protocol, etc. It has many displays to analyse the data in varying and sometimes entertaining ways. Of course, being heavyweight as it is, if all you need to know is that traffic is flowing from A to B, firing this one up may be overkill, though it would easily suit as a very quick and dirty network monitoring solution. And a few others that I haven't found so useful myself, but someone else might: itop - top for interrupts. I can imagine it would be useful for checking if hardware is getting the computers attention when it should be. jnettop - this is another network top. I prefer iftop since it gives me a graphical display (and it's help page is somewhat more detailed than "I must write something here... :)"). -- On the day *I* go to work for Microsoft, faint oinking sounds will be heard from far overhead, the moon will not merely turn blue but develop polkadots, and hell will freeze over so solid the brimstone will go superconductive. -- Erik Raymond, 2005 -- Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the HourOn Tue, Sep 16, 2008 at 4:25 AM, Ian <darkstarsword@...> wrote:
> I'll start the ball rolling with several top variants: Top stuff Ian. -- MC -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the Hour> Top stuff Ian.
<tick> I realise that these ones may well be more well-known but here goes. vidir - ever want to rename/remove a bunch of files in some directory and got tired of typing mv/rm and just wish to just "edit" a directory? mmv - yet another renamer meaning you can do this: mmv '*.hdr' '#1.img' a -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the HourOne I use a lot is fmt. If I'm editing text in vi I normally use "set wm=5" to get the
line wrapping at the 5th to last column. After making changes though the formatting gets out of whack. I then use the "!" with a moving command to send a block of the file through "fmt". e.g. { - Go to the blank line before a paragraph. !}fmt - Send the paragraph through fmt. Or 3 paragraphs !3}fmt Or for the entire document (which is probably not what you want): 1G!Gfmt Brett -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the HourIan wrote on 16/9/08 4:25 AM:
> > I'll start the ball rolling with several top variants: > Ian, Thanks for a great question and more so, for introducing me to new tools here. Perhaps you or someone on list knows how to chase down a problem I once saw: - a process was spawning/forking processes as fast as the system could do it. On Solaris I didn't have a good tool to identify the problem or find the process quickly :-( What do I use everyday? - top, lsof, traceroute/tracepath, nmap, tcpdump - ssh & rsync + the shell :-) regards s -- Steve Jenkin, Info Tech, Systems and Design Specialist. 0412 786 915 (+61 412 786 915) PO Box 48, Kippax ACT 2615, AUSTRALIA sjenkin@... http://members.tip.net.au/~sjenkin -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the HourOn Tue, 16 Sep 2008 04:25:35 +1000
Ian <darkstarsword@...> wrote: > Ok, I want to start a bit of a discussion here - I want everyone to > chime in and tell the list of any random, obscure and useful commands > they know of. Anything you have come across that has helped you in > some way or you thought would be really handy in some situation, > doesn't matter what. For all the times you forget to use sudo first up sudo !! -- Owen -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the HourOwen wrote:
> On Tue, 16 Sep 2008 04:25:35 +1000 > Ian <darkstarsword@...> wrote: > > >> Ok, I want to start a bit of a discussion here - I want everyone to >> chime in and tell the list of any random, obscure and useful commands >> they know of. Anything you have come across that has helped you in >> some way or you thought would be really handy in some situation, >> doesn't matter what. >> > > > For all the times you forget to use sudo first up > > sudo !! > > Because `sudo echo foo > file` won't work when you don't have permission to change file, the shell does the redirection. `echo foo | sudo tee file` will work for you. David -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the Hour> And sudo tee > Because `sudo echo foo > file` won't work when you don't have > permission to change file, the shell does the redirection. > `echo foo | sudo tee file` will work for you. I use dd for this: echo 1 | sudo dd of=/proc/sys/net/ipv4/ip_forward - which gives you the same semantics as bash redirection (ie, the output isn't copied to stdout) Cheers, Jeremy -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the HourAnd of course the absolute best program for remote admin - screen,
everyone must already be using it... If you put this in /etc/screenrc or ~/.screenrc it even has tabs: # Screen configuration # Statusbar hardstatus off hardstatus alwayslastline hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %d/%m %C%a" # Scrolling in xterms termcapinfo xterm|xterms|xs|rxvt ti@:te@ # Miscellaneous startup_message off Michael. On Tue, Sep 16, 2008 at 11:06 AM, Jeremy Kerr <jk@...> wrote: > >> And sudo tee >> Because `sudo echo foo > file` won't work when you don't have >> permission to change file, the shell does the redirection. >> `echo foo | sudo tee file` will work for you. > > I use dd for this: > > echo 1 | sudo dd of=/proc/sys/net/ipv4/ip_forward > > - which gives you the same semantics as bash redirection (ie, the output > isn't copied to stdout) > > Cheers, > > > Jeremy > > > -- > linux mailing list > linux@... > https://lists.samba.org/mailman/listinfo/linux > linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the Hour> And of course the absolute best program for remote admin - screen, > everyone must already be using it... and while we're at it: http://ozlabs.org/~jk/docs/screen-x.php : using screen to share a console between two users - helpful for collaboration, without having to start an entire vnc session. Cheers, Jeremy -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the HourOn Tue, 16 Sep 2008 04:25:35 am Ian wrote:
> random, obscure and useful commands lsof # What mis-begotten spawn of the devil has bound my http port? > lsof -i:http # The service is running but outside clients can't see it. # What ports do I need to open in the firewall? > lsof -i -u squeezecenter # And I couldn't have come up with the last example without "man" > man lsof Lots of stuff about how to run lsof # Which brings up my least favourite command, ever seen this? "The full documentation for ls is maintained as a Texinfo manual. If the info and ls programs are properly installed at your site, the command info coreutils 'ls invocation' should give you access to the complete manual." # So try it ... 8^( > info ls You will be plunged into an emaxian hell from which there are only 2 escapes: - A PhD in computing science - Closing the shell window # Further study will reveal that all this pain # is a primitive* attempt to implement hyperlinks. # The web provides a useful implementation so try: http://localhost/cgi-bin/info2html # And I couldn't finish without mentioning the Command of the Century > rsync # And then there's the Command of the Next Century > refloat <path 1> <path2> Which finds similar branches below the paths given, and is an antidote to one to many rsync commands. my $.02 -- Michael James michael.james@... System Administrator voice: 02 6246 5040 CSIRO Bioinformatics Facility fax: 02 6246 5166 No matter how much you pay for software, you always get less than you hoped. Unless you pay nothing, then you get more. * For values of "primitive" < "the big bang" -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the HourOn Tue, 16 Sep 2008, Ian wrote:
> Ok, I want to start a bit of a discussion here - I want everyone to > chime in and tell the list of any random, obscure and useful commands I've thought for many years I should be working more logging into my workflows. I decided to spend the few minutes to actually do it a while back. ---- pbarker@milligan:~$ log "Cleaned up log command a little" 200809161159 - Cleaned up log command a little pbarker@milligan:~$ log "Added a single comment to log command" 200809161200 - Added a single comment to log command pbarker@milligan:~$ tail -2 ~/notes/log 200809161159 - Cleaned up log command a little 200809161200 - Added a single comment to log command pbarker@milligan:~$ log "Noted that the almond tree needs pruning" garden Section 'garden' (file /nethome/pbarker/notes/logs/garden) does not exist pbarker@milligan:~$ touch /nethome/pbarker/notes/logs/garden pbarker@milligan:~$ log "Noted that the almond tree needs pruning" garden 200809161201 - Noted that the almond tree needs pruning pbarker@milligan:~$ cat /nethome/pbarker/notes/logs/garden 200809161201 - Noted that the almond tree needs pruning --- There must be several similar commands out there, but *finding* one is the trick. Writing one seemed easier (and, of course, the NIH syndrome). begin-base64 644 log IyEvYmluL3NoCgpCQVNFRElSPSQoL2Jpbi9scyAtZCB+cGJhcmtlci9ub3Rl cykKCmZ1bmN0aW9uIHVzYWdlKCkgewogICAgZWNobyAiVXNhZ2U6IGxvZyBj b21tZW50IFtzZWN0aW9uXSIKICAgIGV4aXQ7Cn0KCk1FU1NBR0U9JDEKU0VD VElPTj0kMgoKaWYgWyAteiAiJE1FU1NBR0UiIF07IHRoZW4KICB1c2FnZQpm aQoKTE9HRklMRT0iJEJBU0VESVIvbG9nIgppZiBbICEgLXogIiRTRUNUSU9O IiBdOyB0aGVuCiBMT0dGSUxFPSIkQkFTRURJUi9sb2dzLyRTRUNUSU9OIgog aWYgWyAhIC1lICIkTE9HRklMRSIgXTsgdGhlbgogICAgIGVjaG8gIlNlY3Rp b24gJyRTRUNUSU9OJyAoZmlsZSAkTE9HRklMRSkgZG9lcyBub3QgZXhpc3Qi CiAgICAgZXhpdDsKIGZpCmZpCgpEQVRFPWBkYXRlICcrJVklbSVkJUglTSdg ClNUUklORz0iJERBVEUgLSAkTUVTU0FHRSIKCmVjaG8gIiRTVFJJTkciCmVj aG8gJFNUUklORyA+PiRMT0dGSUxFCg== ==== Another gem I came across recently was "stress"; loads a machine's disks/cpu/memory/IO. I used it to load a machine so I could check its power-consumption-under-load. Yours, -- Peter Barker | Programmer,Sysadmin,Geek. pbarker@... | You need a bigger hammer. :: It's a hack! Expect underscores! - Nigel Williams -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the HourI usually use the 'mail' command to do the equivalent of what you are doing with 'log': bob@puddleduck:~$ mail bob@wherever -s Garden Need to prune the almond tree . bob@puddleduck:~% Does most of what I see 'log' doing, but I can do it from diverse (Internet connected) systems and my mail reader is usually not too bad at filing messages by sender/subject and searching through them. Also, mail works not too badly for collaborative work as well (apparently, some people even wrote a Unix-like kernel using internet mail for collaboration... :-) Cheers, Bob Edwards. Peter Barker wrote: > On Tue, 16 Sep 2008, Ian wrote: > >> Ok, I want to start a bit of a discussion here - I want everyone to >> chime in and tell the list of any random, obscure and useful commands > > I've thought for many years I should be working more logging into my > workflows. I decided to spend the few minutes to actually do it a while > back. > > ---- > pbarker@milligan:~$ log "Cleaned up log command a little" > 200809161159 - Cleaned up log command a little > pbarker@milligan:~$ log "Added a single comment to log command" > 200809161200 - Added a single comment to log command > pbarker@milligan:~$ tail -2 ~/notes/log > 200809161159 - Cleaned up log command a little > 200809161200 - Added a single comment to log command > pbarker@milligan:~$ log "Noted that the almond tree needs pruning" garden > Section 'garden' (file /nethome/pbarker/notes/logs/garden) does not exist > pbarker@milligan:~$ touch /nethome/pbarker/notes/logs/garden > pbarker@milligan:~$ log "Noted that the almond tree needs pruning" garden > 200809161201 - Noted that the almond tree needs pruning > pbarker@milligan:~$ cat /nethome/pbarker/notes/logs/garden > 200809161201 - Noted that the almond tree needs pruning > --- > > There must be several similar commands out there, but *finding* one is > the trick. Writing one seemed easier (and, of course, the NIH syndrome). > > begin-base64 644 log > IyEvYmluL3NoCgpCQVNFRElSPSQoL2Jpbi9scyAtZCB+cGJhcmtlci9ub3Rl > cykKCmZ1bmN0aW9uIHVzYWdlKCkgewogICAgZWNobyAiVXNhZ2U6IGxvZyBj > b21tZW50IFtzZWN0aW9uXSIKICAgIGV4aXQ7Cn0KCk1FU1NBR0U9JDEKU0VD > VElPTj0kMgoKaWYgWyAteiAiJE1FU1NBR0UiIF07IHRoZW4KICB1c2FnZQpm > aQoKTE9HRklMRT0iJEJBU0VESVIvbG9nIgppZiBbICEgLXogIiRTRUNUSU9O > IiBdOyB0aGVuCiBMT0dGSUxFPSIkQkFTRURJUi9sb2dzLyRTRUNUSU9OIgog > aWYgWyAhIC1lICIkTE9HRklMRSIgXTsgdGhlbgogICAgIGVjaG8gIlNlY3Rp > b24gJyRTRUNUSU9OJyAoZmlsZSAkTE9HRklMRSkgZG9lcyBub3QgZXhpc3Qi > CiAgICAgZXhpdDsKIGZpCmZpCgpEQVRFPWBkYXRlICcrJVklbSVkJUglTSdg > ClNUUklORz0iJERBVEUgLSAkTUVTU0FHRSIKCmVjaG8gIiRTVFJJTkciCmVj > aG8gJFNUUklORyA+PiRMT0dGSUxFCg== > ==== > > Another gem I came across recently was "stress"; loads a machine's > disks/cpu/memory/IO. I used it to load a machine so I could check its > power-consumption-under-load. > > Yours, -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the Hour2008/9/17 Robert Edwards <bob@...>:
> > I usually use the 'mail' command to do the equivalent of what you are > doing with 'log': > > bob@puddleduck:~$ mail bob@wherever -s Garden > Need to prune the almond tree > . > bob@puddleduck:~% Bob, Does the mail command cause your shell to switch from bash to csh? That's weird!! :-) -- Brett /) _ _ _/_/ / / / _ _// /_)/</= / / (_(_/()/< /// -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the HourBrett Worth wrote:
> 2008/9/17 Robert Edwards <bob@...>: >> I usually use the 'mail' command to do the equivalent of what you are >> doing with 'log': >> >> bob@puddleduck:~$ mail bob@wherever -s Garden >> Need to prune the almond tree >> . >> bob@puddleduck:~% > > Bob, > > Does the mail command cause your shell to switch from bash to csh? > That's weird!! :-) > OK, you got me. A bit of careless cut and pasting which I fixed by hand. Should have gone back and re-selected the text. Boy - you are eagle-eyed! Cheers, Bob Edwards. -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Inaugural 'Eagle-Eye' Award Command of the HourRobert Edwards wrote on 17/9/08 9:48 AM:
I'd like to propose Brett for the Inaugural "CLUG Eagle-Eye" award. This had me chuckling this morning - really good fun! [And isn't that a big chunk of our shared ethos?] It really was quite spectacular - spotting the detail, with such speed. The usual questions about 'awards': - how often? - who decides (being an anarchic collective, 'everyone'?) - what trophy? - special event, normal meeting, or just on-line? Anyone got ideas for other *fun* awards?? - best flame-bait - worst dressed geek - most pizza consumed in a sitting - best code or program [with a special category for Tridge :-)] - longest thread - cutest toy or gizmo - Michael Still award for longest trip to a meeting - best and fairest website - ????? > Brett Worth wrote: >> 2008/9/17 Robert Edwards <bob@...>: >>> I usually use the 'mail' command to do the equivalent of what you are >>> doing with 'log': >>> >>> bob@puddleduck:~$ mail bob@wherever -s Garden >>> Need to prune the almond tree >>> . >>> bob@puddleduck:~% >> >> Bob, >> >> Does the mail command cause your shell to switch from bash to csh? >> That's weird!! :-) >> > > OK, you got me. A bit of careless cut and pasting which I fixed by hand. > Should have gone back and re-selected the text. Boy - you are > eagle-eyed! > > Cheers, > > Bob Edwards. -- Steve Jenkin, Info Tech, Systems and Design Specialist. 0412 786 915 (+61 412 786 915) PO Box 48, Kippax ACT 2615, AUSTRALIA sjenkin@... http://members.tip.net.au/~sjenkin -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Inaugural 'Eagle-Eye' Award Command of the HourI reckon Brett should get an extra slice of Pizza at the next CLUG meeting, in recognition of this outstanding achievement! And whoever wins "most pizza consumed in a sitting" can also get an extra slice - at the same sitting! Bob Edwards. steve jenkin wrote: > Robert Edwards wrote on 17/9/08 9:48 AM: > > I'd like to propose Brett for the Inaugural "CLUG Eagle-Eye" award. > This had me chuckling this morning - really good fun! > [And isn't that a big chunk of our shared ethos?] > > It really was quite spectacular - spotting the detail, with such speed. > > The usual questions about 'awards': > > - how often? > - who decides (being an anarchic collective, 'everyone'?) > - what trophy? > - special event, normal meeting, or just on-line? > > Anyone got ideas for other *fun* awards?? > > - best flame-bait > - worst dressed geek > - most pizza consumed in a sitting > - best code or program [with a special category for Tridge :-)] > - longest thread > - cutest toy or gizmo > - Michael Still award for longest trip to a meeting > - best and fairest website > - ????? > >> Brett Worth wrote: >>> 2008/9/17 Robert Edwards <bob@...>: >>>> I usually use the 'mail' command to do the equivalent of what you are >>>> doing with 'log': >>>> >>>> bob@puddleduck:~$ mail bob@wherever -s Garden >>>> Need to prune the almond tree >>>> . >>>> bob@puddleduck:~% >>> Bob, >>> >>> Does the mail command cause your shell to switch from bash to csh? >>> That's weird!! :-) >>> >> OK, you got me. A bit of careless cut and pasting which I fixed by hand. >> Should have gone back and re-selected the text. Boy - you are >> eagle-eyed! >> >> Cheers, >> >> Bob Edwards. > > -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the HourOn Tue, Sep 16, 2008 at 08:10:18AM +1000, Brett Worth wrote:
> One I use a lot is fmt. If I'm editing text in vi I normally use "set wm=5" to get the > line wrapping at the 5th to last column. After making changes though the formatting gets > out of whack. I then use the "!" with a moving command to send a block of the file > through "fmt". e.g. > > { - Go to the blank line before a paragraph. > !}fmt - Send the paragraph through fmt. Something similar that also works quite well is par http://www.nicemice.net/par/ it handles multiple levels of quoting characters which is really handy for email. One vi command I like is !!sh to execute the current line in a shell. It's useful if you're building up a long one-liner and want to easily document the output and your progress. Or if you want to include the output of previous commands in future commands, for example ls *txt<esc>!!sh edit the output, insert cat at the front of the line and | grep whatever at the end of the line, then <esc>!!sh I find it easier to use than :r! also !!dc for a calculator, for example 4534 445 * 5 / 2 + p<esc>!!dc and again you can use the output of that in your next calculation. It probably doesn't need need pointing out, but if you yyp before you !!dc you can keep a copy of the input. On Tue, Sep 16, 2008 at 11:06:11AM +1000, Jeremy Kerr wrote: > > And sudo tee > > Because `sudo echo foo > file` won't work when you don't have > > permission to change file, the shell does the redirection. > > `echo foo | sudo tee file` will work for you. > > I use dd for this: > > echo 1 | sudo dd of=/proc/sys/net/ipv4/ip_forward > > - which gives you the same semantics as bash redirection (ie, the output > isn't copied to stdout) As much as I appreciate that use of dd, tee has the advantage that you can use the -a option to append to the file like >>. -- linux mailing list linux@... https://lists.samba.org/mailman/listinfo/linux |
|
|
Re: Command of the Hour |