  Eatmeingreek Gentard
join:2001-06-29 San Francisco, CA
| reply to Steve Re: Little Known Tips and Tricks...
said by Steve : Yes, the numbers aren't hard to learn, but they are not relative.
That is a disadvantage to me. I seldom want to set relative permissions on a bunch of files. I often want to set absolute permissions on a single file. -- We must destroy liberty to make the homeland safe for democracy |
|
  sporkme drop the crantini and move it, sister Premium,MVM join:2000-07-01 Morristown, NJ
·Optimum Online
| reply to bbrkdub said by bbrkdub :
# cat ~/bin/scroll
#!/bin/sh cat $@ | less
Why not just "less filename"?
As to vi -R, usually "view" is a link that will do the same. |
|
 dom6791
join:2001-11-23 Bronx, NY
| reply to dom6791 Im totally surprised by everyone's very helpful tips! I had no idea of ANY of these tricks whatsoever. Or of the number of generous posts! Far more than I originally expected 
I have been printing these posts since you guys started  |
|
 paul1238
join:2000-11-03 Brookline, MA
| reply to Steve said by Steve : Yes, the numbers aren't hard to learn
Yeah, I thought so too except for the errors with the numbers in my original post 
Thanks for freerock for pointing them out.
said by paul1238 : rwx------ which represents three sets of bits where each group is made up of three bits. So the groups of bits from right to left describe the: OWNER, GROUP, and WORLD access permissions. Each of the three bits in a group represent READ, WRITE, EXECUTE from right to left.
That should be from left to right. said by paul1238 : Two commonly used bits in the fourth group of bits are the the setuid bit which is 100 000 000 000 (4000 in octal) and the sticky bit which is 100 000 000 000 (1000 in octal).
Obviously, the numbers should not be the same. The sticky bit is 001 000 000 000 which is octal 1000. |
|
  SuperJudge Magus Premium join:2002-11-14 Albany, GA clubs: | reply to dom6791 Hopefully I'll be able to use half of these some day.  -- Updated My Journal |
|
 MrH
join:2001-07-18 Lynnwood, WA
| reply to dom6791 i think we should just jump onto the subject of how too root eachothers boxes so we can test all these cool little tricks 
jp jp jp  |
|
  bbrkdub
join:2001-10-03 Houston, TX
·Comcast
| quote: i think we should just jump onto the subject of how too root eachothers boxes so we can test all these cool little tricks
Let's don't and say we did 
Here's another trick I found while reading and OpenBSD article awhile back. This script outputs the PID of a program, w/o the extra 'grep' PID process being displayed. I stripped a little bit of the documentation portion of my script header, so please excuse the mess.
#!/bin/sh # # Prerequisite(s): # 1) A basic understanding of shell programming. # # Syntax: # pid [pattern] # # Example(s): # pid root # pid sendmail #
if [ $# != 1 ] then echo "Usage: $0 [pattern]" exit 1 fi
ps -awwwwx | grep -v grep | grep $1 -- Hope this helps... |
|
  soulburner
join:2002-09-23 Pahrump, NV
| reply to dom6791 I don't have much to lend, but it was kind of useful to me, so I'll pass it along.
code:
apropos searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output.
So, apropos 'expression' would find all commands that have 'expression' in the name/description of the command.
»www.oreillynet.com/pub/au/73 has also helped me out with learning a few things about my FreeBSD box. |
|
  BeesTea Network Janitor Premium,VIP join:2003-03-08 00000 | reply to bbrkdub Mojosan,
You can just take advantage of shell expansion and accomplish the same thing.
ps -ax | grep [f]oo
will return only procesees named foo, the grep in the process table will not be included.
Cheers, -BeesT |
|
 a_use_r
join:2003-01-10 Troy, MO | reply to dom6791 SSH performance tuning.. I guess
Want to speed up login time with ssh?
vi /(ssh_base)/etc/ssh_prng_cmds
Remove all commands that don't apply to your particular system/os. |
|
  jknowler Tazmo
join:2002-02-16 Argyle, TX
| reply to dom6791 Re: Little Known Tips and Tricks...
I have not seen anything about "filename completion". Key part of the filename and hit the TAB key. Works for directories to! I have worn out more TAB keys on my keyboards. Also, Hit the up and down arrow keys to scroll up and down through previously entered command lines. Once you find the command you want, hit the forward/back arrow keys, make corrections and hit ENTER. *whoosh* 
Edit:I almost forgot, on "filename completion" hit TAB twice to get a listing of possibilities. This is helpful you get lost in a long directory path. -- EL SRS DAK403_P5, SatMex 5/990, GW 144, Proxy Off, RWin 474280, MTU 1500, Dual PII 350's, w/256M Ram, XP Pro w/ICS, RedHat & XP clients [text was edited by author 2003-03-14 20:35:41]
[text was edited by author 2003-03-14 20:37:12] |
|
  bgrundy
join:2002-01-25 Sykesville, MD
| reply to dom6791 Watching a file "grow"...
If I'm moving a large file across a network (piped through rsh or ssh), or dd'ing a large file (disk image, etc.) I cat watch the progress with the "watch" command. Basically, it runs the same command over and over again (every 2 seconds by default).
for example, watching the progress of a 2 GB dd image: -issue the dd command -switch to another terminal -"watch ls -lh" -the "ls" output is updated every two seconds...Progress is now visible.
-- "If you continue to use Windows, your system may become unstable" --BSOD |
|
  Skipdawg The Original Premium,ExMod 2001-03 join:2001-04-19 The Void | I love this online tool for finding RPM's »www.rpmfind.net  -- Proud US Navy Veteran. |
|
  peterr
join:2000-05-10 Encinitas, CA
| reply to dom6791 Here's my fave:
When faced with deleting a file containing weird characters (especially the previously mentioned file starting with "-"), I use the "unlink" command which does not process any switches. This lives in /usr/sbin for linux.
/usr/sbin/unlink -stupid_file_name
/P |
|
  Eatmeingreek Gentard
join:2001-06-29 San Francisco, CA
| reply to jknowler said by jknowler : I have not seen anything about "filename completion". Key part of the filename and hit the TAB key...
This works by default in bash. There are ways to do it in the other shells, but I've never researched it, 'cause I almost always use bash.
BTW, did you know you can configure Windows to do this too?
»www.microsoft.com/windows2000/te···tion.asp »www.fuzzygroup.com/writing/windo···tion.htm -- We must destroy liberty to make the homeland safe for democracy |
|
  Gigantopithi
join:2000-08-08 Homewood, IL clubs:  | reply to dom6791 Use distcc to compile across several hosts. Great for compiling xfree86, kde, gnome. Saves loads of time and is very efficient if done on a lan. -- Do you think that's air you're breathing? |
|
  movement3
join:2002-11-03 Houston, TX
| reply to dom6791 These commands have been helpful to me:
Secure Copy through SSH:
This is handy if you need to copy a file through an encrypted tunnel on one system to another when the file is not under the web or FTP directory.
scp [filename] [remote host address]:/path/remote/computer
scp some_filename bob@domain.com:/home/bob/ or scp some_filename bob@111.111.111.111:/home/bob/
Screen:
Have multiple screens open rather than having several putty sessions open on your desktop. You can also open a screen session, run a process, close putty and the process will continue.
screen to start a screen session Ctrl-a (press Ctrl and a at the same time) n to scroll through your different screens if you have more than one. Ctrl-a d to detached from your screen, and regular to your regular terminal. screen r to resume a running screen session
chattr and lsattr:
One time I wanted to delete a filename but it had chattr +i filename on it, without issuing chattr i you cannot delete or chmod the file. lsattr filename to see what attributes it currently has.
strace:
When you do a top and see a process is taking up the CPU percentage, but you do not know where its coming from. Strace will give you a verbose detail output of what the particular process is doing; it can provide clues for troubleshooting.
strace -s 1000 -fxtvo /root/output -p [Process ID]
With these flags, the results of strace will be sent to /root/output. |
|
  cangeceiro
join:2001-12-12 Indianapolis, IN | reply to dom6791 "man tuning" gives some tips how to tune performance of your FreeBSD system -- Bang Bang Bang your head(on the desk) |
|
  ironwalker World Renowned Premium,MVM join:2001-08-31 Keansburg, NJ clubs:
·Optimum Online
| reply to dom6791 clock on the top of your terminal: Edit the profile file, vi /etc/profile and add the following line: PROMPT_COMMAND='echo -ne "\0337\033[2;999r\033[1;1H\033[00;44m\033[K"`date`"\033[00m\0338"'
The result will look like: -- "LIVE FREE OR DIE"www.Theforumz.com |
|
  Eatmeingreek Gentard
join:2001-06-29 San Francisco, CA
| reply to dom6791 This was a big "duh" for me. I found myself compiling lots of kernels for my old laptop in trying to get the PCMCIA stuff to work properly. Problem was it took forever for them to compile on the wheezy Pentium I 266 CPU it has.
It dawned on me I could compile the kernels on my desktop system and just scp them over...
Better still, my desktop has enough disk space that I can keep lots of different kernel source trees on it. So I could be fiddling with 2.4.19 on the laptop while my desktop crunched away at compiling 2.4.20. -- We must destroy liberty to make the homeland safe for democracy |
|