Life on the Command Line

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#21 Post by Dougal »

8-bit wrote:Did you know that in a terminal, in X or outside of X you can interchange the use of "ls" (linux command) and "dir" (dos command)?
Is this to make windows converts comfortable?
Yes, it's just a matter of including

Code: Select all

alias dir='ls'
in .bashrc...

I've also added to my .bashrc something to make it easier for working from the CLI: with a file manager, when you move to a directory, you immediately see which files are there, so I added

Code: Select all

function qq(){ 
	cd "$1"
	if [ -n "$2" ] ; then
		ls *${2}
	else
		ls
	fi
}
which works thus

Code: Select all

# qq /tmp/    
bootcnt.txt      flashgot.r3y1skkw.slt  modprobe.udev-debug  xerrs.log
bootkernel.log   geany_socket.43bd6348  oldmousedevice
bootsysinit.log  hotpupfifo             photos
boot-timing      modprobes.log          videos
# qq /tmp/ log
bootkernel.log  bootsysinit.log  modprobes.log  xerrs.log
# pwd
/tmp
# 

So with one short command you get to a directory and see its contents...
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
faifpuhp
Posts: 97
Joined: Thu 22 Sep 2011, 06:12

#22 Post by faifpuhp »

Dougal wrote: I've also added to my .bashrc something to make it easier for working from the CLI: with a file manager, when you move to a directory, you immediately see which files are there, so I added

Code: Select all

function qq(){ 
	cd "$1"
	if [ -n "$2" ] ; then
		ls *${2}
	else
		ls
	fi
}
So with one short command you get to a directory and see its contents...
Brilliant!
[url=http://murga-linux.com/puppy/viewtopic.php?p=566477#566477][b]Strawberry is dead[/b][/url][b]![/b]

Post Reply