Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
06-14-2003, 04:18 AM
|
#76
|
|
Member
Registered: Feb 2003
Location: Dominican Republic
Distribution: Slackware, FreeBSD, RedHat
Posts: 326
Rep:
|
I just read the 5 pages!!! This thread rocks!!!!.. P.S I just made a little book about all the tricks for my personal use lol
|
|
|
|
06-14-2003, 07:39 AM
|
#77
|
|
Moderator
Registered: May 2001
Posts: 24,965
|
Sometimes you come across a file you need several consecutive lines of. Shame the part you want doesn't start at line 1 or doesn't end at the last line. Adding this function to your functionlib or ~/.bashrc
Code:
function getLines() { # Get lines from file
arg=( $@ )
if [ "${#arg[@]}" != "3" -o ! -f "${arg[0]}" ]; then
printf "%sgetLines: <file> <from> <to>\n"; else
str=( $(wc -l ${arg[0]}) ); str="${str[0]}"
arg[1]=$(expr ${str} - ${arg[1]})
arg[2]=$(expr ${str} - ${arg[2]})
echo \$-${arg[1]},\$-${arg[2]} p | ed -s ${arg[0]}
fi; unset str; }
now you can "getLines: <file> <first line> <last line>".
Note the "core" is just a simple "ed" line.
|
|
|
|
06-14-2003, 11:02 PM
|
#78
|
|
Member
Registered: Feb 2003
Location: just outside reality
Distribution: balanced
Posts: 752
Rep:
|
what a groovy thread!!
when i read about bash commands it often doesnt sink in but here with the examples some of you gave it made more sense.
like i think i never really paid attention to alias before, seems pretty powerful to me now.
to make sure i got it right: you can type in .bashrc like this:
alias cdnow='cdrecord -v -audio -pad speed=<burning speed> dev=<your device>'
and then when its time type:
cdnow /path/to/*.wav
yes?
|
|
|
|
06-14-2003, 11:26 PM
|
#79
|
|
Senior Member
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503
Rep:
|
yup! pretty cool huh? There is a thread around here somewhere where people posted the different aliases they used. Its pretty cool.
Okay I just went back and read all the pages. Pretty cool stuff. Anyway, I'm sure some of you already know this but I like to use subshells sometimes. If I'm in some crazy directory like /usr/java/j2sdk/plugins/i386/blah/blah and I want to go somewhere else and do something without having to cd back to this directory I can do it in a subshell like this:
[user@localhost ns610]$ pwd
/usr/java/j2sdk1.4.1_02/jre/plugin/i386/ns610
[user@localhost ns610]$ (cd /usr/lib/fakedirctory; ls)
Fake.txt Contents FakeFile.txt
[user@localhost ns610]$ pwd
/usr/java/j2sdk1.4.1_02/jre/plugin/i386/ns610
As you can see, because I enclosed the command in parenthesis it simply kicks me back to the original directory is was in.
Last edited by Crashed_Again; 06-14-2003 at 11:40 PM.
|
|
|
|
06-15-2003, 05:08 PM
|
#80
|
|
Member
Registered: Feb 2003
Location: just outside reality
Distribution: balanced
Posts: 752
Rep:
|
not really a linux trick but id just like to point out the web browser startpage that somebody else here pointed out awhile ago( i cant remember who) where you use a local file with hyperlinked images of all your commonly visited web page logos. i started doing this myself and it sure makes life simpler. and although its a local file i still use the remote images so i always know if a link no longer works as soon as my browser starts.
Last edited by Brain Drop; 06-15-2003 at 05:11 PM.
|
|
|
|
06-16-2003, 04:51 PM
|
#81
|
|
Guru
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141
Rep:
|
Bash Keystroke Combinations
Alt+B -> Go back one word
Alt+F -> Go forth one word
Ctrl+K -> Delete everything from the cursor to the end of the line
Ctrl+U -> Delete everything from the cursor to the beginning of the line
Ctrl+Y -> Paste deleted characters at the current position
Ctrl+H -> Delete one character
Ctrl+L -> Clean screen
Ctrl+P -> Go to the previous history entry
Ctrl+N -> Go to the next history entry
Also you can use !word to re-execute the last command beginning with "word".
Using !word
$ gcc -o test test.c
$ !gcc
gcc -o test test.c
$
|
|
|
|
06-21-2003, 12:18 AM
|
#82
|
|
Guru
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141
Rep:
|
Run a screensaver as your background
For example, to run hopalong as your background, open an x terminal and command:
Code:
nohup /usr/X11R6/lib/xscreensaver/hopalong -root &
nohup = no hangup, i.e. lets process run after x terminal closes, the & returns the terminal for use with the process in the background.
|
|
|
|
06-22-2003, 12:33 PM
|
#83
|
|
Member
Registered: May 2003
Distribution: Fedora Core 3, Gentoo
Posts: 47
Rep:
|
More aliases
I ssh everywhere so I like to make aliases for that, I have a million aliases in my .bash_profile
example
alias server1="ssh me@server1.com" (I can't figure out how to make LQ not think that's an email address...it's not tho)
so all I type on the command line is server1 and away I go. 
|
|
|
|
07-03-2003, 02:29 PM
|
#84
|
root 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 9,585
|
I am trying to gauge the interest in a tips and hints sub-forum. Is this something people would be interested in? Would you post in it?
--jeremy
|
|
|
|
07-03-2003, 02:50 PM
|
#85
|
|
Guru
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141
Rep:
|
 Do I remember suggesing this when I first joined?
I would vote aye!
|
|
|
|
07-03-2003, 05:18 PM
|
#86
|
|
Member
Registered: Jul 2003
Location: London
Posts: 548
Rep:
|
hmm....me thinks that a link to this thread in the newbie section might be a good idea. after all, these kind of tricks are exactly what a newbie wants when trying to get to know linux.
just my $0.02
andy
|
|
|
|
07-03-2003, 05:25 PM
|
#87
|
|
Member
Registered: May 2003
Location: Lisbon Falls, Maine
Distribution: RH 8.0, 9.0, FC2 - 4, Slack 9.0 - 10.2, Knoppix 3.4 - 4.0, LFS,
Posts: 789
Rep:
|
I think it would be a great idea. More than just tips and hints, I would like to see something more comprehensive. Almost like a mini linuxquestions HOWTO forum.
slight
|
|
|
|
07-03-2003, 09:51 PM
|
#88
|
|
Member
Registered: Aug 2002
Location: Phoenix, AZ
Distribution: PCLinuxOS 2012.08
Posts: 406
Rep:
|
YES! YES!
(...jumps up and down, raising both hands to be counted twice)
|
|
|
|
07-04-2003, 10:35 AM
|
#89
|
root 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 9,585
|
Quote:
Originally posted by slightcrazed
I think it would be a great idea. More than just tips and hints, I would like to see something more comprehensive. Almost like a mini linuxquestions HOWTO forum.
slight
|
The LinuxQuestions.org HOWTO section is almost completed.
--jeremy
|
|
|
|
07-05-2003, 02:00 AM
|
#90
|
|
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
|
I haven't read the whole of this thread, so forgive me if this is redundant:
Run two shells in a split window. One above the other. Very useful for programming. . . (Ctrl-W to switch between the two shells by default, can be changed--read the man page).
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:37 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|