Tagged: bash Toggle Comment Threads | Keyboard Shortcuts

  • harlekwinblog 3:08 pm on September 29, 2011 Permalink | Reply
    Tags: bash,   

    Switching betwen two directories in Bash 

    The pushd command remembers the last pushd’ed from directory
    #cd /
    #pushd /home
    #pwd
    /home
    #pushd
    #pwd
    /

    But quicker is “~-” which will simply take you back to the last working directory
    #cd /
    #cd /home
    #pwd
    /home
    #cd ~-
    #pwd
    /

     
  • harlekwinblog 2:07 pm on August 2, 2011 Permalink | Reply
    Tags: bash, ,   

    giving permission to read a specific file using sudo:
    visudo
        #Support Staff
        Cmnd_Alias = LOGS = /bin/cat /var/log/squid/access.log, /bin/zcat /var/log/squid/access.log.[0-9].gz
        %logaccess ALL (all) NOPASSWD: LOGS

    This gives access to the Squid Logs to anyone in the logaccess group.
    (sudo zcat /var/log/squid/access.log.1.gz) | grep "microsoft.com"

    Advertisement
     
  • harlekwinblog 4:51 pm on February 28, 2011 Permalink | Reply
    Tags: bash, e-mail, , mutt   

    Using the file ~/.muttrc you can set the FROM address in outbound messages from the root user to an arbitrary but more appropriate value:
    vim ~/.muttrc
    Add the lines:

    set from=noreply@my.domain
    set envelope_from=yes
    set realname=NoReply

    Or as you see fit – Envelope Sender is also controlled with this setting

     
  • harlekwinblog 3:06 pm on February 21, 2011 Permalink | Reply
    Tags: bash, , screen   

    To share the same interface when on a Linux server you can use screen
    To start a session:
    screen -S {session-name}
    To join a session:
    screen -x {session-name}
    Both administrators will then be able to type commands fully visible to each other.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel