Naked Science Forum
Non Life Sciences => Geek Speak => Topic started by: chris on 21/11/2015 09:20:31
-
Have you got a pearl of wisdom to impart, or a common gotcha, that can help others?
This site has some excellent tips
http://www.linuxuser.co.uk/tutorials/14-command-line-tips-tricks
Love to hear everyone else's tips too...
-
Newcomers can have taste of Linux whilst retaining their Windows OS, via a lightweight [small] version of Linux on a live CD (https://en.wikipedia.org/wiki/Live_CD) or Live USB (https://en.wikipedia.org/wiki/Live_USB), e.g. ...
http://itsfoss.com/lightweight-linux-beginners/
https://www.linux.com/news/enterprise/systems-management/846633-best-lightweight-linux-distros
[ Posted via Puppy Linux (https://en.wikipedia.org/wiki/Puppy_Linux) running Pale Moon internet browser (https://en.wikipedia.org/wiki/Pale_Moon_%28web_browser%29) : a very fast combination ]
-
Nice suggestion.
I've actually begun to write some short guides for myself over recent years; every time I find myself needing to do a certain task that requires a bit of looking up, I make a text doc in a mounted folder on the NAS called "guides"; inserting an alias into .bashrc for "guides" so you can quickly pull up the list and read the relevant reference text, is really helpful.
Maybe I should start posting my guides here; I have a few useful things now...
-
Slackware 14.1 on ext4 file system in X64 is a good one.
http://mirrors.slackware.com/slackware/slackware-iso/
rpm2targz This command makes a red hat RPM package suitable for a Slackware tar.gz install command.
http://www.slackware.com/config/packages.php
-
for very beginners:
1) Use the commands "pwd" and "ls" often, so you don't get lost.
2) Always have a book or manual on hand to double check a command and any additional modifiers or parameters ("info" and "man" commands can help here too)
3) never, ever, use the command "rm *" !!!
4) recall that there are multiple languages one can use (bash, csh, etc.)
5) play around to get used to the interface before getting to work! :-)
-
Tip #1: Configure Bash login to enable shortcut for ls -l as 'll'
Configure "ll" to get informative directory listing without having to type "ls -l"
Either un-comment the alias ll="ls -l" in .bashrc:
In home directory:
nano .bashrc
Look for the line #alias ll='ls -l' and remove the '#'
Save / exit.
On next log in, you can type ll
-
Tip #2: Order directory listings by date, in forward or reverse sequence
Get the directory file listing by date:
ll -t
Alternatively, get the content in reverse date order (oldest to newest) with:
ll -tr
-
Tip #3: Use a beginner-friendly distro like Ubuntu or Linux Mint.
Their package system is great and it's often easier to update programs in Linux than even Windows due to it. Most smartphones and also Macs have similar package managers which help deliver periodic updates. I remember there being a program for Windows back in the 90s called "Oil Change" or something that automatically installs updates for your programs over the internet but I can't believe it still hasn't caught on now... although the Windows Store in Win10 is a good start.
Sorry to digress but another tip: try installing Linux on an older computer that you no longer use anymore. No worries if you screw your computer up and if the installation succeeds, your old computer is usable again (since Linux is often freer of bloatware than Windows.)
-
try installing Linux on an older computer that you no longer use anymore.
Absolutely right; I've got Debian 7 running happily on a machine that is nearly 20 years old; it's being used as an offsite backup so the lack of processor grunt and the absence of more than one core is not a problem. I was pretty impressed that Debian found drivers to support all that ancient technology!
-
mathreal :Sorry to digress but another tip: try installing Linux on an older computer that you no longer use anymore.
Don't agree to that any more since there are normal services such as video and large 20 mega pixel images to process and that requires at least 4GB RAM to struggle nowdays.
Second , i just put Slackware 14.1 into a 4GB but more for the reason of running the giant apps and programming IDE's i have that while are not video or image are huge.
Third , Slackware is always compatible with makefile utility and able to properly support normal UNIX /bin/sh
While other distro's have these underpinning utilities and drivers "in some form or way" they've ..."taken the words and kinda shuffled them around a bit"... (The truth in Advertising) making a unique partially incompatible version only for there own distro!
-
Tip #4: Use Logrotate to keep log files tidy
Use logrotate to keep your log files under control and save disk space. The config file is /etc/logrotate.conf
Here is a useful tutorial: https://support.rackspace.com/how-to/understanding-logrotate-utility/
-
Tip #5: Copy Multiple Files
To copy multiple files picked individually, use this notation:
cp /path-to-your-files-source/{file1,file2,file3,file4} /path-to-where-you-want-to-put-the-files
For big files run in the background in a screen session, this can save a lot of time.
-
Tip #6: Search a directory tree for a specific string or character sequence
This is really powerful, and fast. If you want to track down all the occurrences of a string / sequence in a collection of files e.g. you want to find all the references in old code to, say, https://www.thenakedscientists.com and change them to https://www.thenakedscientists.com/forum it can be a pain finding where all the broken links are; but with this command it will return the list and line number for each occurrence:
grep -rnw '/path/to/search' -e 'string/pattern to look for'
Explanation:
-r or -R is recursive,
-n returns the line number,
-w matches the whole word.
NB: -l (lowercase L) can be added to just give the file names of matching files.
Gold dust!
-
My best advice for Linux newbies is to grab a book about Linux programming using a high-level language such as Perl or Python. This way you can start to code fast small scripts then progressively jump into bigger programs.
-
Learn how to quit vi and then avoid it like the plague.
-
Learn how to quit vi and then avoid it like the plague.
There's nothing wrong to be addicted to vi. Emacs is for bummers... ;)
-
Learn how to quit vi and then avoid it like the plague.
Absolutely! Horrible program.
-
Tip #7: Make an unzipped copy of a .gz file, preserving the original archive
The default behaviour of gunzip is to remove the original .gz file and replace it with the unzipped equivalent. This isn't always ideal. To produce an unzipped copy of the original archive, use the command:
gzcat #source filename.gz# > #output filename#
or
gunzip -c #source filename.gz# > #output filename#
-
My Linux Bibel is:
Getting Started with UBUNTU Linux 16.4,
published by the UBUNTU MANUAL TEAM.
The best for a little money can buy, for me and probably you.
-
Never stop coding.