
Terminal - Commands using cd - 168 results
alias sshdo='ssh -q -t root@localhost -- cd $PWD \&\& sudo'
This is sample output - yours may be different.
Run program as root by SSH key forwarding instead of sudoers.
Put this alias line in .bashrc or wherever you like. Alias arguments might need extra escaping.
You might wonder about security. But you'd block out root login as much as possible of course. In sshd_config you put this:
PermitRootLogin no
Match Address 127.0.0.1
PermitRootLogin without-password
svn co http://simile.mit.edu/repository/crowbar/trunk&& cd ./trunk/xulapp/ xulrunner --install-app && Xvfb :1 && DISPLAY=:1 xulrunner application.ini 2>/dev/null 1>/dev/null && wget -O- "127.0.0.1:10000/&url=http://www.facebook.com"
This is sample output - yours may be different.
some other options:
&delay=1000
&mode=links
much more with piggybank as scraper
works well with your favourite curses or non-curses http clients
to() { eval dir=\$$1; cd "$dir"; }
This is sample output - yours may be different.
Set a bookmark as normal shell variable
p=/cumbersome/path/to/project
To go there
to p
This saves one "$" and is faster to type ;-) The variable is still useful as such:
vim $p/<TAB>
will expand the variable (at least in bash) and show a list of files to edit.
If setting the bookmarks is too much typing you could add another function
bm() { eval $1=$(pwd); }
then bookmark the current directory with
bm p
cd ~/Desktop && for FILES in $(ls); do mv $FILES .${FILES}; done
This is sample output - yours may be different.
cd $(find -inum inode_no)
This is sample output - yours may be different.
First use ls -i to list files and directories with their inode number
Then if you want to change to one of the directories, replace inode_no with its inode then execute the command
This is sample output - yours may be different.
$cd /usr/local/
$echo !$
/usr/local/
using "!$" will save another ton of typing than 'ALT+.' or ' .'
(cd /bin; set -- *; x=$((1+($RANDOM % $#))); man ${!x})
This is sample output - yours may be different.
tar -cf - ./file | lzma -c | ssh user@sshserver $(cd /tmp; tar --lzma -xf -)
This is sample output - yours may be different.
This is sample output - yours may be different.
bsro3 () { P=`pwd`; S=$1; R=$2; ls *.odt > /dev/null 2>&1; if [[ $? -ne 0 ]]; then exit 1; fi; for i in *.odt; do mkdir ${P}/T; cd ${P}/T; unzip -qq "$P"/"$i"; sed -i "s/$S/$R/" ${P}/T/content.xml; zip -qq -r "$P"/"$i" *; cd ${P}; rm -rf ${P}/T; done; }
This is sample output - yours may be different.
This function does a batch edition of all OOO3 Writer files in current directory. It uses sed to search a FOO pattern into body text of each file, then replace it to foo pattern (only the first match) . I did it because I've some hundreds of OOO3 Writer files where I did need to edit one word in each ones and open up each file in OOO3 gui wasn't an option. Usage: bsro3 FOO foo
for d in $(find . -maxdepth 1 -type d -name '[^.]*'); do cd "$d"; svn up; cd ..; done
This is sample output - yours may be different.
Authentication realm: <https://foo.com:443> foo-project
Password for 'foodoo':
At revision 221.
If you have a directory with many working copies of various subversion projects and you want to update them all at once, this one may be for you.
cd /some/empty/folder/website_diffs/sitename && wget -N http://domain.com/ 2>&1 |grep -q "o newer" || printf "Sites web page appears to have updated.\n\nSuggest you check it out.\n\n"|mail -s "Sites page updated." david@email.com
This is sample output - yours may be different.
A cronjob command line to email someone when a webpages homepage is updated.
find ~ -maxdepth 2 -name .git -print | while read repo; do cd $(dirname $repo); git pull; done
This is sample output - yours may be different.
cd() { if [ -z "$1" ]; then command cd; else if [ -f "$1" ]; then command cd $(dirname "$1"); else command cd "$1"; fi; fi; }
This is sample output - yours may be different.
{ /root } # tail /var/log/messages
{ /root } # ... # ohh, I need to watch more logfiles
{ /root } # cd <alt+.> # to get last parameter
{ /var/log } # # Ready for action in the files folder
This little function will smarten 'cd'. If you try to cd into a file (which I guess we all have done), it cd's into the directory of that file instead.
I had to use nesten if's, to get cd to still work with 'cd' (to get to $HOME), 'cd -' (to get to last directory), and 'cd foo\ bar'.
cd /etc/init.d && sudo ./apache2 start
This is sample output - yours may be different.
* Starting web server apache2 [ OK ]
This command is designed in order to avoid this error :
/etc/init.d/apache2 force-reload
* Reloading web server config apache2 httpd not running, trying to start
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[fail]
for host in *; do { if [ -d $host ]; then { cd ${host}; for share in *; do { if [ -d $share ]; then { cd $share; rsync -av --delete rsyncuser@$host::$share . 2>../$share.err 1>../$share.log; cd ..; }; fi; }; done; cd ..; }; fi; }; done;
This is sample output - yours may be different.
traverses e.g. "/data/myhost1.com/myrsyncshare"; logs stderr and stdout. useful with cron.
export QQ=$(mktemp -d);(cd $QQ; curl -s -O http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/[0-2400:25];for i in $(perl -ne 'print "$1\n" if( /^(\w+\(\))/ )' *|sort -u);do grep -h -m1 -B1 $i *; done)|grep -v '^--' > clf.sh;rm -r $QQ
This is sample output - yours may be different.
Each shell function has its own summary line, as a comment. If there are multiple shell functions with the same name, the function with the highest number of votes is put into the file.
Note: added 'grep -v' to the end of the pipeline, to eliminate extraneous lines containing only '--'. Thanks to matthewbauer for pointing this out.
dmd () { ( if [ "$1"x != "x" ]; then cd $1; fi; mkdir `date +%Y%m%d` ) }
This is sample output - yours may be different.
$ # in '.'
$ dmd
$ ls -l
drwxr-xr-x 2 bchittenden bchittenden 4096 2010-01-27 10:26 20100127
$ # in 'test/asdf/'
$ mkdir -p test/asdf
$ dmd test/asdf
$ ls -l test/asdf
drwxr-xr-x 2 bchittenden bchittenden 4096 2010-01-27 10:29 20100127
Creates a directory named with the current date, in the format YYYYMMDD. If you give it a directory name as an argument, it will create the new directory inside the specified directory.
This is an alternative to command #1993.
removedir(){ read -p "Delete the current directory $PWD ? " human;if [ "$human" = "yes" ]; then [ -z "${PWD##*/}" ] && { echo "$PWD not set" >&2;return 1;}; rm -Rf ../"${PWD##*/}"/ && cd ..; else echo "I'm watching you" | pv -qL 10; fi; }
This is sample output - yours may be different.
[user@host foo]$ removedir
Delete the current directory /home/user/asdf/.hidden/a b c/foo ? no
I'm watching you
[user@host foo]$ removedir
Delete the current directory /home/user/asdf/.hidden/a b c/foo ? yes
[user@host a b c]$ removedir
Delete the current directory /home/user/asdf/.hidden/a b c ? yes
[user@host .hidden]$ removedir
Delete the current directory /home/user/asdf/.hidden ? yes
[user@host asdf]$ unset PWD
[user@host asdf]$ removedir
Delete the current directory ? yes
$PWD not set
[user@host asdf]$
May want to change echos to more descriptive (more than 255 characters) such as:
$ removedir(){ read -p "You are about to delete the current directory $PWD Are you sure? " human;if [ "$human" = "yes" ]; then [ -z "${PWD##*/}" ] && { echo "Error: Couldn't get working directory" >&2;return 1;}; rm -Rf ../"${PWD##*/}"/ && cd ..; else echo "I'm watching you" | pv -qL 10; fi; }
Credit goes to "eightmillion"
removedir () { echo "Deleting the current directory $PWD Are you sure?"; read human; if [[ "$human" = "yes" ]]; then blah=$(echo "$PWD" | sed 's/ /\\ /g'); foo=$(basename "$blah"); rm -Rf ../$foo/ && cd ..; else echo "I'm watching you" | pv -qL 10; fi; }
This is sample output - yours may be different.
#### Use example ####
[user@host Downloads]$ wtzc http://raoulito.info/plugins/pidgin_screenshot/pidgin-sendscreenshot-0.6-3.tar.gz
[user@host pidgin-sendscreenshot-0.6-3]$ ls
aclocal.m4 config.h.in INSTALL m4 README
AUTHORS config.sub install-sh Makefile.am src
build-aux configure intltool-extract.in Makefile.in VERSION
ChangeLog configure.ac intltool-merge.in missing
config COPYING intltool-update.in NEWS
config.guess depcomp ltmain.sh po
[user@host pidgin-sendscreenshot-0.6-3]$ removedir
You are about to delete the current directory /home/user/Downloads/pidgin-sendscreenshot-0.6-3/ Are you sure?
yes
[user@host Downloads]$
CHANGELOG
Version 1.1
removedir () { echo "You are about to delete the current directory $PWD Are you sure?"; read human; if [[ "$human" = "yes" ]]; then blah=$(echo "$PWD" | sed 's/ /\\ /g'); foo=$(basename "$blah"); rm -Rf ../$foo/ && cd ..; else echo "I'm watching you" | pv -qL 10; fi; }
BUG FIX:
Folders with spaces
Version 1.0
removedir () { echo "You are about to delete the current directory $PWD Are you sure?"; read human; if [[ "$human" = "yes" ]]; then blah=`basename $PWD`; rm -Rf ../$blah/ && cd ..; else echo "I'm watching you" | pv -qL 10; fi; }
BUG FIX:
Hidden directories (.dotdirectory)
Version 0.9
rmdir () { echo "You are about to delete the current directory $PWD. Are you sure?"; read human; if [[ "$human" = "yes" ]]; then blah=`basename $PWD`; rm -Rf ../$blah/ && cd ..; else echo "I'm watching you" | pv -qL 10; fi; }
Removes current directory with recursive and force flags plus basic human check. When prompted type yes
1. [user@host ~]$ ls
foo bar
2. [user@host ~]$ cd foo
3. [user@host foo]$ removedir
4. yes
5. rm -Rf foo/
6. [user@host ~]$
7. [user@host ~]$ ls
bar
wtzc () { wget "$@"; foo=`echo "$@" | sed 's:.*/::'`; tar xzvf $foo; blah=`echo $foo | sed 's:,*/::'`; bar=`echo $blah | sed -e 's/\(.*\)\..*/\1/' -e 's/\(.*\)\..*/\1/'`; cd $bar; ls; }
This is sample output - yours may be different.
[user@host Downloads]$ wtzc http://www.zlib.net/zlib-1.2.3.tar.gz
--2010-01-17 03:19:56-- http://www.zlib.net/zlib-1.2.3.tar.gz
Resolving www.zlib.net... 69.73.181.135
Connecting to www.zlib.net|69.73.181.135|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 496597 (485K) [application/x-tar]
Saving to: `zlib-1.2.3.tar.gz'
100%[======================================>] 496,597 337K/s in 1.4s
2010-01-17 03:19:58 (337 KB/s) - `zlib-1.2.3.tar.gz' saved [496597/496597]
zlib-1.2.3/
zlib-1.2.3/adler32.c
zlib-1.2.3/algorithm.txt
zlib-1.2.3/amiga/
zlib-1.2.3/amiga/Makefile.pup
zlib-1.2.3/amiga/Makefile.sas
zlib-1.2.3/as400/
zlib-1.2.3/as400/bndsrc
zlib-1.2.3/as400/compile.clp
zlib-1.2.3/as400/readme.txt
zlib-1.2.3/as400/zlib.inc
zlib-1.2.3/ChangeLog
zlib-1.2.3/compress.c
zlib-1.2.3/configure
zlib-1.2.3/contrib/
zlib-1.2.3/contrib/ada/
zlib-1.2.3/contrib/ada/buffer_demo.adb
zlib-1.2.3/contrib/ada/mtest.adb
zlib-1.2.3/contrib/ada/read.adb
zlib-1.2.3/contrib/ada/readme.txt
zlib-1.2.3/contrib/ada/test.adb
zlib-1.2.3/contrib/ada/zlib-streams.adb
zlib-1.2.3/contrib/ada/zlib-streams.ads
zlib-1.2.3/contrib/ada/zlib-thin.adb
zlib-1.2.3/contrib/ada/zlib-thin.ads
zlib-1.2.3/contrib/ada/zlib.adb
zlib-1.2.3/contrib/ada/zlib.ads
zlib-1.2.3/contrib/ada/zlib.gpr
zlib-1.2.3/contrib/asm586/
zlib-1.2.3/contrib/asm586/match.S
zlib-1.2.3/contrib/asm586/README.586
zlib-1.2.3/contrib/asm686/
zlib-1.2.3/contrib/asm686/match.S
zlib-1.2.3/contrib/asm686/README.686
zlib-1.2.3/contrib/blast/
zlib-1.2.3/contrib/blast/blast.c
zlib-1.2.3/contrib/blast/blast.h
zlib-1.2.3/contrib/blast/Makefile
zlib-1.2.3/contrib/blast/README
zlib-1.2.3/contrib/blast/test.pk
zlib-1.2.3/contrib/blast/test.txt
zlib-1.2.3/contrib/delphi/
zlib-1.2.3/contrib/delphi/readme.txt
zlib-1.2.3/contrib/delphi/ZLib.pas
zlib-1.2.3/contrib/delphi/ZLibConst.pas
zlib-1.2.3/contrib/delphi/zlibd32.mak
zlib-1.2.3/contrib/dotzlib/
zlib-1.2.3/contrib/dotzlib/DotZLib/
zlib-1.2.3/contrib/dotzlib/DotZLib/AssemblyInfo.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/ChecksumImpl.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/CircularBuffer.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/CodecBase.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/Deflater.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/DotZLib.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/DotZLib.csproj
zlib-1.2.3/contrib/dotzlib/DotZLib/GZipStream.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/Inflater.cs
zlib-1.2.3/contrib/dotzlib/DotZLib/UnitTests.cs
zlib-1.2.3/contrib/dotzlib/DotZLib.build
zlib-1.2.3/contrib/dotzlib/DotZLib.chm
zlib-1.2.3/contrib/dotzlib/DotZLib.sln
zlib-1.2.3/contrib/dotzlib/LICENSE_1_0.txt
zlib-1.2.3/contrib/dotzlib/readme.txt
zlib-1.2.3/contrib/infback9/
zlib-1.2.3/contrib/infback9/infback9.c
zlib-1.2.3/contrib/infback9/infback9.h
zlib-1.2.3/contrib/infback9/inffix9.h
zlib-1.2.3/contrib/infback9/inflate9.h
zlib-1.2.3/contrib/infback9/inftree9.c
zlib-1.2.3/contrib/infback9/inftree9.h
zlib-1.2.3/contrib/infback9/README
zlib-1.2.3/contrib/inflate86/
zlib-1.2.3/contrib/inflate86/inffas86.c
zlib-1.2.3/contrib/inflate86/inffast.S
zlib-1.2.3/contrib/iostream/
zlib-1.2.3/contrib/iostream/test.cpp
zlib-1.2.3/contrib/iostream/zfstream.cpp
zlib-1.2.3/contrib/iostream/zfstream.h
zlib-1.2.3/contrib/iostream2/
zlib-1.2.3/contrib/iostream2/zstream.h
zlib-1.2.3/contrib/iostream2/zstream_test.cpp
zlib-1.2.3/contrib/iostream3/
zlib-1.2.3/contrib/iostream3/README
zlib-1.2.3/contrib/iostream3/test.cc
zlib-1.2.3/contrib/iostream3/TODO
zlib-1.2.3/contrib/iostream3/zfstream.cc
zlib-1.2.3/contrib/iostream3/zfstream.h
zlib-1.2.3/contrib/masm686/
zlib-1.2.3/contrib/masm686/match.asm
zlib-1.2.3/contrib/masmx64/
zlib-1.2.3/contrib/masmx64/bld_ml64.bat
zlib-1.2.3/contrib/masmx64/gvmat64.asm
zlib-1.2.3/contrib/masmx64/gvmat64.obj
zlib-1.2.3/contrib/masmx64/inffas8664.c
zlib-1.2.3/contrib/masmx64/inffasx64.asm
zlib-1.2.3/contrib/masmx64/inffasx64.obj
zlib-1.2.3/contrib/masmx64/readme.txt
zlib-1.2.3/contrib/masmx86/
zlib-1.2.3/contrib/masmx86/bld_ml32.bat
zlib-1.2.3/contrib/masmx86/gvmat32.asm
zlib-1.2.3/contrib/masmx86/gvmat32.obj
zlib-1.2.3/contrib/masmx86/gvmat32c.c
zlib-1.2.3/contrib/masmx86/inffas32.asm
zlib-1.2.3/contrib/masmx86/inffas32.obj
zlib-1.2.3/contrib/masmx86/mkasm.bat
zlib-1.2.3/contrib/masmx86/readme.txt
zlib-1.2.3/contrib/minizip/
zlib-1.2.3/contrib/minizip/ChangeLogUnzip
zlib-1.2.3/contrib/minizip/crypt.h
zlib-1.2.3/contrib/minizip/ioapi.c
zlib-1.2.3/contrib/minizip/ioapi.h
zlib-1.2.3/contrib/minizip/iowin32.c
zlib-1.2.3/contrib/minizip/iowin32.h
zlib-1.2.3/contrib/minizip/Makefile
zlib-1.2.3/contrib/minizip/miniunz.c
zlib-1.2.3/contrib/minizip/minizip.c
zlib-1.2.3/contrib/minizip/mztools.c
zlib-1.2.3/contrib/minizip/mztools.h
zlib-1.2.3/contrib/minizip/unzip.c
zlib-1.2.3/contrib/minizip/unzip.h
zlib-1.2.3/contrib/minizip/zip.c
zlib-1.2.3/contrib/minizip/zip.h
zlib-1.2.3/contrib/pascal/
zlib-1.2.3/contrib/pascal/example.pas
zlib-1.2.3/contrib/pascal/readme.txt
zlib-1.2.3/contrib/pascal/zlibd32.mak
zlib-1.2.3/contrib/pascal/zlibpas.pas
zlib-1.2.3/contrib/puff/
zlib-1.2.3/contrib/puff/Makefile
zlib-1.2.3/contrib/puff/puff.c
zlib-1.2.3/contrib/puff/puff.h
zlib-1.2.3/contrib/puff/README
zlib-1.2.3/contrib/puff/zeros.raw
zlib-1.2.3/contrib/README.contrib
zlib-1.2.3/contrib/testzlib/
zlib-1.2.3/contrib/testzlib/testzlib.c
zlib-1.2.3/contrib/testzlib/testzlib.txt
zlib-1.2.3/contrib/untgz/
zlib-1.2.3/contrib/untgz/Makefile
zlib-1.2.3/contrib/untgz/Makefile.msc
zlib-1.2.3/contrib/untgz/untgz.c
zlib-1.2.3/contrib/vstudio/
zlib-1.2.3/contrib/vstudio/readme.txt
zlib-1.2.3/contrib/vstudio/vc7/
zlib-1.2.3/contrib/vstudio/vc7/miniunz.vcproj
zlib-1.2.3/contrib/vstudio/vc7/minizip.vcproj
zlib-1.2.3/contrib/vstudio/vc7/testzlib.vcproj
zlib-1.2.3/contrib/vstudio/vc7/zlib.rc
zlib-1.2.3/contrib/vstudio/vc7/zlibstat.vcproj
zlib-1.2.3/contrib/vstudio/vc7/zlibvc.def
zlib-1.2.3/contrib/vstudio/vc7/zlibvc.sln
zlib-1.2.3/contrib/vstudio/vc7/zlibvc.vcproj
zlib-1.2.3/contrib/vstudio/vc8/
zlib-1.2.3/contrib/vstudio/vc8/miniunz.vcproj
zlib-1.2.3/contrib/vstudio/vc8/minizip.vcproj
zlib-1.2.3/contrib/vstudio/vc8/testzlib.vcproj
zlib-1.2.3/contrib/vstudio/vc8/testzlibdll.vcproj
zlib-1.2.3/contrib/vstudio/vc8/zlib.rc
zlib-1.2.3/contrib/vstudio/vc8/zlibstat.vcproj
zlib-1.2.3/contrib/vstudio/vc8/zlibvc.def
zlib-1.2.3/contrib/vstudio/vc8/zlibvc.sln
zlib-1.2.3/contrib/vstudio/vc8/zlibvc.vcproj
zlib-1.2.3/crc32.c
zlib-1.2.3/crc32.h
zlib-1.2.3/deflate.c
zlib-1.2.3/deflate.h
zlib-1.2.3/example.c
zlib-1.2.3/examples/
zlib-1.2.3/examples/fitblk.c
zlib-1.2.3/examples/gun.c
zlib-1.2.3/examples/gzappend.c
zlib-1.2.3/examples/gzjoin.c
zlib-1.2.3/examples/gzlog.c
zlib-1.2.3/examples/gzlog.h
zlib-1.2.3/examples/README.examples
zlib-1.2.3/examples/zlib_how.html
zlib-1.2.3/examples/zpipe.c
zlib-1.2.3/examples/zran.c
zlib-1.2.3/FAQ
zlib-1.2.3/gzio.c
zlib-1.2.3/INDEX
zlib-1.2.3/infback.c
zlib-1.2.3/inffast.c
zlib-1.2.3/inffast.h
zlib-1.2.3/inffixed.h
zlib-1.2.3/inflate.c
zlib-1.2.3/inflate.h
zlib-1.2.3/inftrees.c
zlib-1.2.3/inftrees.h
zlib-1.2.3/make_vms.com
zlib-1.2.3/Makefile
zlib-1.2.3/Makefile.in
zlib-1.2.3/minigzip.c
zlib-1.2.3/msdos/
zlib-1.2.3/msdos/Makefile.bor
zlib-1.2.3/msdos/Makefile.dj2
zlib-1.2.3/msdos/Makefile.emx
zlib-1.2.3/msdos/Makefile.msc
zlib-1.2.3/msdos/Makefile.tc
zlib-1.2.3/old/
zlib-1.2.3/old/descrip.mms
zlib-1.2.3/old/Makefile.riscos
zlib-1.2.3/old/os2/
zlib-1.2.3/old/os2/Makefile.os2
zlib-1.2.3/old/os2/zlib.def
zlib-1.2.3/old/README
zlib-1.2.3/old/visual-basic.txt
zlib-1.2.3/old/zlib.html
zlib-1.2.3/projects/
zlib-1.2.3/projects/README.projects
zlib-1.2.3/projects/visualc6/
zlib-1.2.3/projects/visualc6/example.dsp
zlib-1.2.3/projects/visualc6/minigzip.dsp
zlib-1.2.3/projects/visualc6/README.txt
zlib-1.2.3/projects/visualc6/zlib.dsp
zlib-1.2.3/projects/visualc6/zlib.dsw
zlib-1.2.3/qnx/
zlib-1.2.3/qnx/package.qpg
zlib-1.2.3/README
zlib-1.2.3/trees.c
zlib-1.2.3/trees.h
zlib-1.2.3/uncompr.c
zlib-1.2.3/win32/
zlib-1.2.3/win32/DLL_FAQ.txt
zlib-1.2.3/win32/Makefile.bor
zlib-1.2.3/win32/Makefile.emx
zlib-1.2.3/win32/Makefile.gcc
zlib-1.2.3/win32/Makefile.msc
zlib-1.2.3/win32/VisualC.txt
zlib-1.2.3/win32/zlib.def
zlib-1.2.3/win32/zlib1.rc
zlib-1.2.3/zconf.h
zlib-1.2.3/zconf.in.h
zlib-1.2.3/zlib.3
zlib-1.2.3/zlib.h
zlib-1.2.3/zutil.c
zlib-1.2.3/zutil.h
adler32.c crc32.c INDEX inftrees.h qnx zlib.3
algorithm.txt crc32.h infback.c Makefile README zlib.h
amiga deflate.c inffast.c Makefile.in trees.c zutil.c
as400 deflate.h inffast.h make_vms.com trees.h zutil.h
ChangeLog example.c inffixed.h minigzip.c uncompr.c
compress.c examples inflate.c msdos win32
configure FAQ inflate.h old zconf.h
contrib gzio.c inftrees.c projects zconf.in.h
[user@host zlib-1.2.3]$
Combines a few repetitive tasks when compiling source code. Especially useful when a hypen in a file-name breaks tab completion.
1.) wget source.tar.gz
2.) tar xzvf source.tar.gz
3.) cd source
4.) ls
From there you can run ./configure, make and etc.
This is sample output - yours may be different.
_ expands to the last argument of the last command that was executed
echo 'mkcd() { mkdir -p "$@" && cd "$_"; }' >> ~/.bashrc
This is sample output - yours may be different.
~/#$ mkcd /path/to/new/folder
/path/to/new/folder#$_
combines mkdir and cd
added quotes around $_, thanx to flatcap!
function ..(){ for ((j=${1:-1},i=0;i<j;i++));do builtin cd ..;done;}
This is sample output - yours may be different.
Instead of typing "cd ../../.." you can type ".. 3". For extremely lazy typists, you can add this alias:
alias ...=".. 2" ....=".. 3"
- so now you can write just .... !!!
NB the .. function needs to be "source"d or included in your startup scripts, perhaps .bashrc.
cd /usr/home && for i in *;do chsh -s bash $i;done
This is sample output - yours may be different.
This command will set bash as the default shell for all users in a FreeBSD system.