-   Linux - General (
-   -   Tricks and hints (

neo77777 08-15-2002 12:17 AM

Tricks and hints
Jeremy, would you take for concideration to setup a *NIX tricks and hints secton, for instance I have a couple:
1) CDPATH env variable, if it is set for instance
[bash ~]$ export CDPATH=/usr/local/apache
when you enter from any directory you're in
[bash /var/log]$ cd htdocs
it will take you to /usr/local/apache/htdocs
2) !! at the command shell executes the last executed command
!m - executes the last command in history that starts with m for instance mail
!m:p (thsis is a colon p, not a smile face :D) will print what was the last command that starts with m
3) hitting twice z while holding a shift key in vi in command mode saves the edited file and quits vi
4) touch -t 197001012100 foo updates atime on foo to Jan 1 1970 you just need to add hhmm (2100)
5) man manpage|col -b>manpage.txt
is usefull to redirect a rather big man page to a text file in easy readable format
6) Getting rid off annoying ^M (CTRL-M) in dos like files
tr -d "\015" < /dosfile > /unixfile
also possible in use in vi with search-and-replace command :%s/^M//g to get ^M you press CTRL+V+M
To be continued ...
Regards, Neo

MasterC 08-15-2002 01:37 AM

Hey thanks Boris, those are pretty sweet. I think something like that would be a great idea, maybe as a sticky in one of the forums. I will add this one to my subscribed threads though in case that idea never makes it.

Again, thanks!

GT I.N.C 08-15-2002 05:26 AM

i want a jokes forum *cries* :p

jeremy 08-15-2002 08:12 AM

Tips and tricks might not be a bad idea. Not sure if I would rather have a forum for this or a seperate section. Let me think about that. FYI, you can disable smilies in a post by clicking the "Disable Smilies in This Post " checkbox. Thanks for the suggestion.


neo77777 08-15-2002 08:33 AM

Hi, Jeremy it would be great, I think a separate section makes sense, also we can have a tip of the day or smtg along these lines.
P.S. And thatnks for the tip on disabling smilies, cool, I always descover something new over here even though this new has been here for a while.

neo77777 08-15-2002 10:41 PM

Here is another one, ever wonder what takes so much space on you precious *NIX box run this
find $1 -type d | xargs du -sm | sort -g
from the directory in question and the most hungry chunk will show up last.

Thymox 08-17-2002 07:49 PM

How about rather than giving a specific forum over to Tips 'n' Tricks, something like the Glossary/Man pages thing is set up? In order to prevent overloading of really-basic-everyone-already-knows-it tips, perhaps either a moderator could be appointed to remove any that are deemed to be stupidly simply, or as with the Glossary thing, the tips are emailed to Jeremy direct and He sifts through them and decides?

Just my 2 pence (we've not got the Euro... yet?)

MasterC 08-18-2002 11:12 AM

WHAT? I thought just about everyone over there had converted to the Euro. Like 12 something countries already right? This is about as far as my knowledge goes outside of my "sheltered" little existence over here in the US.


Thymox 08-18-2002 06:34 PM

Yeah, I think it's more like 15 (not sure... will check later). Even Eire (Southern Ireland/Republic of Ireland to everyone else) have gone over to the Euro, but us Englanders haven't yet. I'm betting that we will within the next 5 years, though.

Config 08-19-2002 06:19 AM

Good or bad: neither did switzerland :)

MasterC 08-19-2002 06:57 AM

Well then... I thought everyone did or was going to by now, but it appears that I am sadly mistaken. :(

dai 08-19-2002 09:06 AM

Nerither did Cymru :) (Wales)

Thymox 08-19-2002 01:36 PM

Dai, forgive me for asking, but is Wales considered a seperate country by the EU yet? This is not a flame... I know that Scotland is considered a seperate country, but I thought that Wales was considered as more of a partially-autonomic principality?

dai 08-20-2002 02:18 AM

Hi Thymox I dont think we are classed as a seperate political state as of yet (We voted against it 52% to 48% I believe). Which Im glad about coz as much as I love my country I just dont think we would be able to sustain ourselves without being part of the UK. I mean some of these Assembly Members that we have as part of the devolution process dont really have much of a clue and are far more interested in minor issues than issues that affect the whole of the country. In principle it is good that we have more control over issues that affect our country, but I dont think our general assembly should be granted more powers until they can handle it.

Mind you I still love it when Wales beat England ;)

Im just not one of those crazy people who think we should throw everybody who cant speak Welsh out of the country.

neo77777 08-21-2002 02:49 PM

Oohh, I love it when the discussion drifts off the topic :D. But here is another one, ever wonder you can learn perl right on your PC without going to online tutorials - install perl and perldoc (which is a part of perl)
type perldoc perl and see what you can get out of it.
Peace everyone.

All times are GMT -5. The time now is 10:21 AM.