Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

sed

global search and replace

sed -e 's/foo/bar/g' myfile.txt

mount

mount a drive

mount -f nfs code:/mnt/data

locate

like find, only better

screen

like nohup and script together in a single package, only better

scp

secure copy

  • example 1
    • scp -i ~/.ssh/id_dsa -r source_dir user@remote_host:/target/path
    • -i: uses identity file (private key) at ~/.ssh/id_dsa
    • -r: recursive
  • example 2
    • scp -i ~/.ssh/id_dsa_uploader filetoupload root@sfgov2.3tera.net:/app/mad_sfmap_images/main.images/root/

simple command lines

# lists previous commands
$ history

# executes command number 123 from the shell history
$ !123

# print shared library dependencies
ldd yourFileName

user administration (for root only)


# create a new user
$ useradd newuser

# at this point the account is disabled; to enable, set the passwd
[root@gis03v5wiki home]# passwd svnadmin
Changing password for user svnadmin.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

# delete a user
userdel loseruser

setting up snmp

sdfjskldf

command line idioms

# find and remove log files
$ find . -name "*.log" | xargs rm

# how many jpeg files are in layer-group_hybrid?
$ find layer-group_hybrid -name "*.jpeg" | wc

# what is the timestamp of youngest file within an entire directory structure?
$ find . -name "*.png" | xargs ls -l | awk '{print $6 " " $7}' | sort | head -1

# what is the timestamp of oldest file within an entire directory structure?
$ find . -name "*.png" | xargs ls -l | awk '{print $6 " " $7}' | sort | tail -1




location location location

http://www.pathname.com/fhs/pub/fhs-2.3.html

executables are here:

/sbin

/usr/sbin

Your path or even in the path of root may not have these.

if it is broke

check the permissions

consider version compatibility

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.