-
oh, whilst were adding scripts that do our job for us...
apt-get update <- put that in your cron.daily directory ... The amount of times ive forgotten to run that file installed a program only to realise there is an update .... :(
lsof is also good for listing open files (this includes devices etc very useful for programs hogging a device)
lsof | grep /dev/dsp
I have to close some programs via that method because they lock my DSP
-
*su - root - If you just type su, not everything is exported, i.e. shell aliases and ls colors
-
Here's a way to use already existing command features that I've discovered some are not aware of:
Doing just a cd without syntax behind it will automagically redirect you back to the home directory of whatever user you happen to be logged in as.
test@/etc/dvd/> cd
Logged in as test will bring you back to /home/test
Logged in as test and under su root, will bring you back to /root
-
Quote:
Originally posted here by Lansing_Banda
*su - root - If you just type su, not everything is exported, i.e. shell aliases and ls colors
or just,
[code]su -[code]
:D
-
the most annoying part about su is that it doesn't even export the PATH.
Anyway, since I like this thread so much, here's my contribution (to tack onto Guardian Alpha, if I may):
will get you back to your previous working directory
example:
Code:
[root@me /]cd /usr/bin
[root@me bin]# cd /etc
[root@me etc]# cd -
/usr/bin
[root@me bin]#
it's a real time saver.
ik
-
a few time savers:
pgrep
pkill
zcat
zmore
zgrep
also, someone mentionned lsof, which has fstat for equivalent in bsd...
Ammo
-
Something that I find very useful is the screen command.
It comes in handy when you want to SSH back to the same session on a box. For example if you're running some kind of client eg an IRC client, usually when you close the SSH session you won't be able to go back to your IRC screen. The program screen solves this. Here's an example:
Code:
screen -t irc Bitchx
Now you're running Bitchx on a new terminal. To get back to your original terminal you press ^ad (Control+A, then D). The D stands for Detach.
You can now close your SSH session while the Bitchx client still runs. When you SSH in again, run the command
And voila you're looking at the same Bitchx client you left running before.
-
Backgrounding ssh port forwarders, ability to use same terminal setting up multiple forwarders. This way you don't accidently close your term and thus killing your forwarder.
ssh -f -N -L 8080:123.123.123.123:80 username@hostname.com
-
Just to get back on my own post :) Why use tar instead of move or copy?
mv/cp screws up symlinks, tar doesn't. That's the reason I had problems :rolleyes:
-
I would still have to tend to either use scp or rsync w/ ssh encryption when copying files/dirs between hosts. But again its all more of a personnal opinion. Theres 50 different ways of doing it on unix :cool: