Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Console / shell tips & tricks
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4 ... 14, 15, 16  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Caffeine
Guru
Guru


Joined: 17 Jul 2002
Posts: 401
Location: Melbourne, Australia

PostPosted: Wed Apr 09, 2003 1:18 pm    Post subject: Reply with quote

NiklasH wrote:
wbsoft wrote:
Code:

nd() { test -d "$1" || mkdir "$1" && cd "$1" ; }
alias o="less -iMS"
nX()
{
  for i in `seq 0 9`
  do
    if [ ! -e "/tmp/.X${i}-lock" ] ; then
      XFree86 ":$i" -query localhost &
      break
    fi
  done
}

the last one, nX, starts a new X login on a new display. (You should add localhost to /etc/X11/xdm/Xaccess)


I can't get this to work...
The nX function starts a new X window, but I get no login prompt (gdm, in my case).
Am I doing something wrong? I tried to add just 'localhost' in Xaccess. Should I add something more? I also tried to add CHOOSER localhost, but that didn't work either.
Maybe I'm just stupid... :? But I would really like this to work, so any help is very appreciated!


I'm having the same problem. What's the correct entry in Xaccess?
Back to top
View user's profile Send private message
Jarjar
Apprentice
Apprentice


Joined: 21 Jul 2002
Posts: 265
Location: Sweden

PostPosted: Wed Apr 09, 2003 1:36 pm    Post subject: Reply with quote

For killing wine(x) when it ... fucks up.
Code:

/usr/bin/killall-that-contains: (can't think of a name; help me!)
#!/bin/sh
if [ $1 == "-9" ]
then
        for i in $(ps aux|grep $2|grep -v grep|cut -c10-15)
        do
                kill -9 $i
        done
else
        for i in $(ps aux|grep $1|grep -v grep|cut -c10-15)
        do
                kill $i
        done
fi

Warning: Bash scripting newbie. :D
The only alias I use, except for ll/ls (--color=yes --show-control-chars) is
alias startx='startx -- -dpi 100'

Edit: Oopsie! I reversed the if and else; it kill -9'ed if you told it not to and the other way around...fixed.
_________________
[Server etc. | C2D 2.2 @ 3.0 GHz / 4 GB RAM / 3x1 TB + 1x2 TB SATA disks + 1.5 TB ext. | Gentoo]
[Laptop | Macbook Pro 15" / Core i7 (Sandy) Quad 2.2 GHz / 16 GB RAM / Samsung 840 250 GB SSD + 1 TB + 2 TB HDD / 6750M 1 GB / OS X, Win 7]
Back to top
View user's profile Send private message
guero61
l33t
l33t


Joined: 14 Oct 2002
Posts: 811
Location: Behind you

PostPosted: Thu Apr 10, 2003 2:48 am    Post subject: Reply with quote

My few toys that are useful outside of the private networks I use --

Code:

alias psg="ps -awef |grep"
alias psu="ps -u"
alias ct="tar -cvzf"
alias xt="tar -xvpf"
alias xzt="tar -xvzpf"
alias xjt="tar -xvjpf"
alias ll="ls -lF --color"
alias lla="ls -laF --color"
alias r="fc -s"

set -o vi



Those, and I love using "cd -", it saves so much typing!
Back to top
View user's profile Send private message
Jimbow
Guru
Guru


Joined: 18 Feb 2003
Posts: 597
Location: Silver City, NM

PostPosted: Thu Apr 10, 2003 3:22 am    Post subject: Reply with quote

Here are some (hopefully) non-dups:
Code:

alias snice="sudo nice -n 5"
alias smerge="snice emerge"
alias kern="snice make dep && snice make clean bzImage modules modules_install"

loc () {
    locate -i $@ | grep -v ^/usr/portage | grep -v ^/var
}

burn () {
    sudo cdrecord -v speed=4 dev=0,0,0 -data $1
}

start () {
    nohup $@ &
}

#-------- long ls listings /w pager --------
ll  () { ls -lF   $@ | more;}
lla () { ls -lAF  $@ | more;}
llt () { ls -lAFt $@ | more;}

#-------- clean: removes emacs *~ and #*# files --------
clean () {
    if [[ "$#" == "0" ]] ; then set '.'; fi;
    for dir in $@; do
        if [[ -d $dir ]]; then
            rm -f ${dir}/*~ $dir/#*#;
        else
            echo "clean: missing directory '${dir}'"
        fi
    done;
}

#-------- li: ls -F if directory, less if file --------
li (){
    if [[ -d $1 ]] ; then
         ls -F $1;
    elif [[ -f $1 ]] ; then
        less $1;
    else
        ls -F $1
    fi
}

_________________
After Perl everything else is just assembly language.
Back to top
View user's profile Send private message
Yarrick
Bodhisattva
Bodhisattva


Joined: 05 Jun 2002
Posts: 304
Location: Malmö, Sweden

PostPosted: Thu Apr 10, 2003 3:42 am    Post subject: Reply with quote

Code:
ls -h
can also be useful. It displays file sizes as human-readable, using giga/mega/kilo/bytes for size instead of just bytes.

somtimes i miss an alias to mkdir && cd a new folder... havent written one yet though.
Back to top
View user's profile Send private message
morgap98
n00b
n00b


Joined: 02 Nov 2002
Posts: 25

PostPosted: Thu May 22, 2003 9:08 pm    Post subject: Reply with quote

i can't get my laptop to parse the .bashrc file. The only time that i can make changes to my bash prompts are through the /etc/profile script.

NOTE: if i type "bash" [enter] then it will parse my .bashrc,

how can i get this to automatically happen, i don't think i should be modifiying my /etc/profile script like this!!!

</P33T>
Back to top
View user's profile Send private message
BackSeat
Apprentice
Apprentice


Joined: 12 Apr 2002
Posts: 242
Location: Reading, UK

PostPosted: Thu May 22, 2003 9:56 pm    Post subject: Reply with quote

For those unfamiliar with ^R reverse search in bash, here's an extra tip. After ^R type a few characters and the command line that contained those characters will be shown. Type ^R again at that point, and the search will continue back through the history.

For those aliasing ls='ls --color' you might prefer to use
Code:
lss='ls --color=auto'
That way the coloUr escape sequences are only sent if the output is connected to a terminal (so sending the output of ls to a file doesn't result in embedded escape sequences.

In a similar way, I alias grep:
Code:
alias grep --color-auto
which highlights the matching pattern in the output. Try it: you'll never want to be without it.

Finally (for now), if you think 'less' is just a way of paging through a file, read the man page. There is more flexibility in this program than a lot of people realise.

BS
Back to top
View user's profile Send private message
Redson
Tux's lil' helper
Tux's lil' helper


Joined: 15 Apr 2003
Posts: 137

PostPosted: Thu May 22, 2003 11:07 pm    Post subject: FORTUNE RULES!!!! Reply with quote

tactless wrote:
Not really a "trick", but here's something I put in my bashrc:
Code:
fortune


Great way to start the day :)[/code]


That is awesome! You inspired me to write my first pseudo bash script!!!!
It essentially picks a certain type of fortune depending on what day it is.
I put it in my bashrc:


Code:
NUMBER_OF_FORTUNES=3
DATE=`eval date +%d`  #Produces only the date Number.

let "DATE=$DATE%$NUMBER_OF_FORTUNES"

case "$DATE" in
   [0]  ) fortune;; #Random fortune
   [1]  ) fortune /usr/share/fortune/starwars;;  #Quoute from Star Wars
   [2]  ) fortune /usr/share/fortune/homer;;  #Quote from Homer
esac


note that to do this you need to
emerge fortune-mod-homer
emerge fortune-mod-starwars

I would also recommend doing emerge -s fortune for a list of other cool fortune files.
_________________
Redson
http://watchred.com/
Back to top
View user's profile Send private message
Redson
Tux's lil' helper
Tux's lil' helper


Joined: 15 Apr 2003
Posts: 137

PostPosted: Thu May 22, 2003 11:26 pm    Post subject: Reply with quote

morgap98 wrote:
i can't get my laptop to parse the .bashrc file. The only time that i can make changes to my bash prompts are through the /etc/profile script.

NOTE: if i type "bash" [enter] then it will parse my .bashrc,

how can i get this to automatically happen, i don't think i should be modifiying my /etc/profile script like this!!!

</P33T>


Hello fellow N00B! I had this problem for a while, fortunately somebody finally told me you have to put
Code:
[ -f ~/.bashrc ] && source ~/.bashrc

at the end of your .bash_profile so it reads your .bashrc

After doing that I think you have to do
Code:
source .bash_profile
env-update


though I'm not sure about that. Then remember to restart your shell before the .bashrc takes effect
_________________
Redson
http://watchred.com/
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Fri May 23, 2003 9:52 pm    Post subject: Reply with quote

Since we are all sharing and beeing very happy in this thread, I thought I was going to add to the confusion 8)

Here is my .bash_profile
Code:

alias ls="ls --color=auto"
alias l="ls -l "
alias lm="ls -l| more"
alias la="ls -a "
alias llm="ls -la | more"
alias ln="ls -lLt | more"
alias cdo="cd $ORACLE_HOME"
## LS_COLORS should be on one line, broken up here as not to mess up phpBB too much :)
export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:
or=40;31;01:ex=00;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:
*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:
*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:
*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:
*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:';
alias grep="grep --color=auto"
shopt -s cdspell
shopt -s cdable_vars
shopt -s checkhash
shopt -s checkwinsize
shopt -s mailwarn
shopt -s sourcepath
shopt -s no_empty_cmd_completion
shopt -s histappend histreedit
shopt -s extglob

shopt -s extglob   # necessary

complete -A hostname   rsh rcp telnet rlogin r ftp ping disk ssh
complete -A command    nohup exec eval trace strace gdb
complete -A command    command type which
complete -A export     printenv
complete -A variable   export local readonly unset
complete -A enabled    builtin
complete -A alias      alias unalias
complete -A function   function
complete -A user       su mail finger

complete -A helptopic  help   # currently same as builtins
complete -A shopt      shopt
complete -A stopped -P '%' bg
complete -A job -P '%'     fg jobs disown

complete -A directory  mkdir rmdir

complete -f -X '*.gz'   gzip
complete -f -X '!*.ps'  gs ghostview gv
complete -f -X '!*.pdf' acroread
complete -f -X '!*.+(gif|jpg|jpeg|GIF|JPG|bmp)' xv gimp

function lowercase()  # move filenames to lowercase
{
    for file ; do
        filename=${file##*/}
        case "$filename" in
        */*) dirname==${file%/*} ;;
        *) dirname=.;;
        esac
        nf=$(echo $filename | tr A-Z a-z)
        newname="${dirname}/${nf}"
        if [ "$nf" != "$filename" ]; then
            mv "$file" "$newname"
            echo "lowercase: $file --> $newname"
        else
            echo "lowercase: $file not changed."
        fi
    done
}

function xtitle ()
{
    case $TERM in
   xterm* | dtterm | rxvt)
       echo -n -e "\033]0;$*\007" ;;
   *)  ;;
    esac
}

alias top='xtitle Processes on $HOST && top'
alias eworld='xtitle Emerge update world && emerge -u --deep world'
alias esync='xtitle Emerge rsync in progress && emerge rsync'
alias ncftp="xtitle ncFTP ; ncftp"
alias splus="xtitle SQL*Plus && sqlplus \"/ as sysdba\""


Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
balk
n00b
n00b


Joined: 10 Apr 2002
Posts: 62
Location: Olanda

PostPosted: Fri May 23, 2003 11:38 pm    Post subject: Reply with quote

BackSeat wrote:

Finally (for now), if you think 'less' is just a way of paging through a file, read the man page. There is more flexibility in this program than a lot of people realise.

BS

How often I press '/' in any other program when trying to search for a word! Should be implemented in every browser too. Less rules

I also curse on Windows when I try to alt-drag a window... nice features
_________________
Powered by Gentoo since 1.0_rc6
Back to top
View user's profile Send private message
grant.mcdorman
Apprentice
Apprentice


Joined: 29 Jan 2003
Posts: 295
Location: Toronto, ON, Canada

PostPosted: Sat May 24, 2003 12:15 am    Post subject: Reply with quote

NiklasH wrote:
wbsoft wrote:
Code:

nX()
{
  for i in `seq 0 9`
  do
    if [ ! -e "/tmp/.X${i}-lock" ] ; then
      XFree86 ":$i" -query localhost &
      break
    fi
  done
}

the last one, nX, starts a new X login on a new display. (You should add localhost to /etc/X11/xdm/Xaccess)


I can't get this to work...
The nX function starts a new X window, but I get no login prompt (gdm, in my case).
Am I doing something wrong? I tried to add just 'localhost' in Xaccess. Should I add something more? I also tried to add CHOOSER localhost, but that didn't work either.
Maybe I'm just stupid... :? But I would really like this to work, so any help is very appreciated!


You need to do several things to get this to work.

First off, most display managers - especially kdm and gdm - are configured to ignore the -query (technically, it's XDMCP Query). You need to modify your window manager configuration file.

Display manager configuration

For kdm, it is in /usr/kde/3.1/share/config/kdm/kdmrc (the 3.1 will vary, of course, if you're running a release other than 3.1.x). In this file you will find:
Code:
[Xdmcp]
# Whether KDM should listen to XDMCP requests. Default is true.
#Enable=false
# The UDP port KDM should listen on for XDMCP requests. Don't change the 177.
#Port=177
# File with the private keys of X-terminals. Required for XDM authentication.
# Default is ""
#KeyFile=/usr/kde/3.1/share/config/kdm/kdmkeys
# XDMCP access control file in the usual XDM-Xaccess format.
# Default is /usr/kde/3.1/share/config/kdm/Xaccess
# XXX i'm planning to absorb this file into kdmrc, but i'm not sure how to
# do this best.
Xaccess=/etc/X11/xdm/Xaccess

Make sure that the 'Enable=false' line is commented out, and the 'Xaccess=/etc/X11/xdm/Xaccess' is not commented out.

For gdm, please check this next section; I don't have gdm installed. However, according to the online references I can find, its configuration files are in /etc/gdm/Init/gdm.conf.

In this file, set it up as follows:
Code:
[xdmcp]
Enable=1

I can't see a configuration for Xaccess, so presumably it uses the standard one.

Xaccess configuration
For most purposes, you just need to add the following line to /etc/X11/xdm/Xaccess:
Code:
*

That's it (one asterix). You can make it more restrictive - the comments in the file should be adequate.

The nX function should now work.

Note, by the way, that there is a hole in this script: the presence of the /tmp/.Xn-lock is not a 100% guarantee that there's a server running, as this file might be left around if the server crashes.

Important: Firewalling
Be sure to have UDP port 177 closed on your firewall (if it's a sensible firewall, you have to explicitly open ports). The protocol used - XDMCP - is not that secure; in addition, if you use the Xaccess setup I've suggested your display manager will offer login windows to any X display - including random unknown ones on the Internet, if they can get at ports 177 and 6000 on your machine.
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Sat May 24, 2003 12:47 am    Post subject: Reply with quote

oh well, I might just add to that:
Code:

alias dir="echo NO SUCH FILE OR DIRECTORY"
alias x="startx"
alias y="startx -- :1"
alias h="history"
alias ..="cd .."
alias cd..="cd .."
alias ...="cd ~"
alias nano="nano -w -T 4"
alias pico="nano -w -T 4"

and for root:
Code:

alias unmerge="emerge unmerge"
alias semerge="screen emerge"


also note that you can prefix any command with a \ backslash to escape any aliases you have set. So \pico would launch a real pico instead of the nano alias...
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
flickerfly
l33t
l33t


Joined: 08 Nov 2002
Posts: 677
Location: Lanham, MD

PostPosted: Mon Jun 23, 2003 4:52 pm    Post subject: Reply with quote

nitro322 wrote:
If you haven't noticed, the left and right windows keys on your keyboard will change you to the virtual terminal to the left and right of your current one. Nice.


How? I use fluxbox, you?
_________________
An Evil Genious' Guide to Sheeple and How To Avoid Becoming One | 0x4C9EF4A
Back to top
View user's profile Send private message
carambola5
Apprentice
Apprentice


Joined: 10 Jul 2002
Posts: 214

PostPosted: Mon Jun 23, 2003 8:17 pm    Post subject: Reply with quote

flickerfly wrote:
nitro322 wrote:
If you haven't noticed, the left and right windows keys on your keyboard will change you to the virtual terminal to the left and right of your current one. Nice.


How? I use fluxbox, you?


For fluxbox, put this in your ~/.fluxbox/keys
Code:
...
None Super_R :NextWorkspace
None Super_L :PrevWorkspace
...


Other fun keys mods are (assuming a multimedia keyboard):
Code:
None XF86AudioPlay :ExecCommand xmms -t
None XF86AudioStop :ExecCommand xmms -s
None XF86AudioPrev :ExecCommand xmms -r
None XF86AudioNext :ExecCommand xmms -f
None XF86AudioLowerVolume :ExecCommand ~/bin/changevol d
None XF86AudioRaiseVolume :ExecCommand ~/bin/changevol u
None Print :ExecCommand ~/bin/screenie

where changevol is (I removed my muting code because I'm not sure if it works or not):
Code:
#!/bin/bash
case $1 in
  "d") aumix -v-2
    ;;
  "u") aumix -v+2
    ;;
  "*") echo "Error"
esac


and screenie is:
Code:
#!/bin/bash
PICPATH=$HOME/pictures/screenshots
if [ -f "$PICPATH/index.dat" ]; then echo 1 > $PICPATH/index.dat; fi
INDEX=`cat $PICPATH/index.dat`
import -window root $PICPATH/ss$INDEX.png
echo $(($INDEX + 1)) > $PICPATH/index.dat

(I think that'll work)
Back to top
View user's profile Send private message
Brandy
Bodhisattva
Bodhisattva


Joined: 08 Jun 2003
Posts: 820
Location: New Zealand

PostPosted: Tue Jun 24, 2003 2:13 am    Post subject: Reply with quote

klieber wrote:
I find it remarkable how many people don't use the history command. That, combined with the '!n' to re-issue a frequently-used command saves me tons and tons of time.

I agree. The history is sometimes very useful. You can also use it to fix spelling mistakes. :)
Let's say you want to add a new user:
Code:
root@dante / # usradd -m -c "Brandy Westcott" brandy -g users -G wheel,portage -s /bin/bash
bash: usradd: command not found

hmm... bad spelling. No problem:
Code:
^sr^ser
useradd -m -c "Brandy Westcott" brandy -g users -G wheel,portage -s /bin/bash

^string1^string2 is really just the same as !!:s/string1/string2

Ciao, Brandy
_________________
Faber est suae quisque fortunae.
Back to top
View user's profile Send private message
flickerfly
l33t
l33t


Joined: 08 Nov 2002
Posts: 677
Location: Lanham, MD

PostPosted: Tue Jun 24, 2003 11:13 am    Post subject: Reply with quote

:idea:
carambola5 wrote:

Code:
...
None Super_R :NextWorkspace
None Super_L :PrevWorkspace
...


Thanks, I don't have a multimedia keyboard here though. This will be nice to work with and I'll keep the multimedia stuff in memory for later. Thanks. :D
_________________
An Evil Genious' Guide to Sheeple and How To Avoid Becoming One | 0x4C9EF4A
Back to top
View user's profile Send private message
burmashave
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2002
Posts: 82

PostPosted: Tue Jun 24, 2003 8:54 pm    Post subject: Reply with quote

Wow, this is a superb thread! I've been using Linux for about 2 years now; however, I couldn't figure out how the power users got by without using some gui tools.

I've added "history" and "ls" commands to my bashrc, and also added fortune. Thanks for all the above suggestions.

I often find myself grepping about for files, and the only find command I can remember is "find --iname", so I wrote a script to handle my find operations:
Code:
#! /bin/sh

# findfile -- a utility for finding files and directories

PATH=/usr/bin:/bin; export PATH

case $1 in
   fn) find -iname $2 -print 2>/dev/null | more;;
    fs) find -size +$2k -print 2>/dev/null | more;;
    fm) find -cmin -$2 -print 2>/dev/null | more;;
    fd) find -iname $2 -type d -print 2>/dev/null | more;;
    fds) du -m * 2>/dev/null | sort -rn | head -$2;;
    ffs) PERCENTAGE=$2
      df -kl | grep -iv filesystem |  awk '{  print $6" "$5} '| while
          read LINE; do
           PERC=`echo $LINE | cut -d"%" -f1 | awk '{  print $2 } '`
           if [ $PERC -gt $PERCENTAGE ]
               then
             echo $LINE 
           fi
            done;;
   fbad) find . -type l -print 2>/dev/null | perl -nle '-e || print';;
    f) echo "findfile usage:"
       echo
      echo "fn <name>   find file <name>, case insensitive, errors suppressed, wildcards OK"
      echo "fs <n>      find file greater than <n> kilobytes"
      echo "fm <n>      find file modified within last n minutes"
      echo "fd <name>   find directory <name>, case insensitive"
      echo "fds <n>     find top <n> directories, based on diskspace usage (in megabytes)"
      echo "ffs <n>     find file systems with usage greater than <n> percent"
      echo "fbad        find bad symlinks"
      echo "f           list findfile options"
      echo
    esac


Then, I added the following aliases to bashrc:
Code:
alias fn="findfile fn"
alias fs="findfile fs"   
alias fm="findfile fm"
alias fd="findfile fd"   
alias fds="findfile fds"
alias ffs="findfile ffs"
alias fbad="findfile fbad"
alias f="findfile f"


I put the findfile script in PATH, and now I can find files using a short command, or simply enter "f" to get a list of my find options:
Code:
admin@cruise admin $ f
findfile usage:
 
fn <name>   find file <name>, case insensitive, errors suppressed, wildcards OK
fs <n>        find file greater than <n> kilobytes
fm <n>        find file modified within last n minutes
fd <name>  find directory <name>, case insensitive
fds <n>       find top <n> directories, based on diskspace usage (in megabytes)
ffs <n>       find file systems with usage greater than <n> percent
fbad            find bad symlinks
f                 list findfile options


As my title implies, I am a noob, so I would welcome any suggestions about my script.

Another thing I put in bashrc is an alias for my SSH connections:
Code:
alias myserver="ssh -l admin xxx.xxx.xxx.xxx" # ssh to server


If you're using a key to authenticate, the command "myserver" will automatically initiate a session.
Back to top
View user's profile Send private message
thadk
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jun 2002
Posts: 123

PostPosted: Mon Jul 28, 2003 7:17 am    Post subject: Reply with quote

Quick Question: How can you make any process run like a daemon. I.e. how can you run a process and then close the xterm window or ssh session and still have the process run in the background.

Also I have a tip: To search through files looking for specific content you can use:
Code:

$ find . -exec grep -H [search-string] {} \;
OR
$ grep -R [search-string] *
Back to top
View user's profile Send private message
scap1784
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 225

PostPosted: Mon Jul 28, 2003 9:27 am    Post subject: Reply with quote

Code:
alias burn="cdrecord -vv speed=8 dev=0,0,0  -eject "


I also made a few 4 letter words aliases for fortune so when my friends get on here and get mad at the computer it talks back! kinda a stress reiliver i guess
Back to top
View user's profile Send private message
viperlin
Veteran
Veteran


Joined: 15 Apr 2003
Posts: 1319
Location: UK

PostPosted: Mon Jul 28, 2003 9:47 am    Post subject: Reply with quote

probably THE most usefull one ever:
Code:

alias lsd="ls --color -d */"


try it, it's lovely and really usefull in those massive directory's.
Back to top
View user's profile Send private message
vers_iq
Apprentice
Apprentice


Joined: 18 May 2002
Posts: 264

PostPosted: Mon Jul 28, 2003 3:47 pm    Post subject: Reply with quote

Empty_One wrote:
dumb question, but how is the hisory better than just cycling through the list with the up arrow? Seems like you would have to read thru the list anyway


The function of history is not only to repeat a certain command, but it's most useful to keep track the chain of command line in certain console. expecially if u are in the middle of a task which requires u to enter command inputs in particular order.
_________________
"You know the world is going crazy when the best rapper is a white guy, the best golfer is a black guy, the Swiss hold the America's cup, France accusing the US of arrogance and Germany doesn't want to go to war."
Back to top
View user's profile Send private message
Bellrang QT
Tux's lil' helper
Tux's lil' helper


Joined: 16 May 2003
Posts: 81

PostPosted: Mon Jul 28, 2003 4:32 pm    Post subject: Reply with quote

Probably another dumb question...

Is there a way to control what shows up in the titlebar of Putty? When I emerge (using an ssh session with Putty), the titlebar is changed. When emerge is done, the titlebar just displayed "xterm".

When I ssh into my RedHat box, it shows user@machine... that's kinda nice.

Any ideas?
_________________
I <3 forums.gentoo.org
Back to top
View user's profile Send private message
nico--
n00b
n00b


Joined: 29 Jul 2002
Posts: 59

PostPosted: Mon Jul 28, 2003 10:34 pm    Post subject: Reply with quote

thadk wrote:
Quick Question: How can you make any process run like a daemon. I.e. how can you run a process and then close the xterm window or ssh session and still have the process run in the background.


Use &:
Code:
mpg123 mylegallyrippedmp3file.mp3 &


If you leave the xterm open you still get output from the program... you have to redirect the output to /dev/null but i can't remember how to do that, heh.
_________________
Quidquid latine dictum sit, altum viditur.
Back to top
View user's profile Send private message
thadk
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jun 2002
Posts: 123

PostPosted: Mon Jul 28, 2003 10:51 pm    Post subject: Reply with quote

No, I'm pretty sure that a backgrounded(&) process dies when it's parent (the xterm/ssh session) does. I'm trying to figure out how to make it so the parent is pid 1 (at least thats the definition of a daemon I found)

With kde I can sort of do what I want with `kdeinit`
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3, 4 ... 14, 15, 16  Next
Page 3 of 16

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum