Difference between revisions of "Linux - N00b tips!"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
 
Line 11: Line 11:
'''<big>BUT</big>... stop & think about what you're trying to do first!'''
'''<big>BUT</big>... stop & think about what you're trying to do first!'''


= Personalising Configurations =
== PATH addition to allow your own scripts & programs to run ==
Sometimes, you'll want to have some executable stuff of your very own. These things don't need to be accessible to all users on the machine. But, it's be nice to be able to run them without specifying the complete path...
Create a <code>bin</code> directory in your home directory:
* <code>mkdir ~/bin</code>
Then edit your <code>.bashrc</code> file:
* <code>vim ~/.bashrc</code>
and add the following line:
* <code>export PATH="$HOME/bin:$PATH"</code>
(you can activate this change immediately by:
* <code>source .bashrc</code>
)
Place your scripts & executables in this directory & you can now execute them as if they were regular system executables.
== Extend (or eliminate) the sudo timeout ==
Once a user has been authenticated, [...] the user may then use sudo without a password for a short period of time (5 minutes unless overridden by the timestamp_timeout option).
To change this universally (i.e.: for all users)
* <code>sudo visudo</code>
To change it for a specific user:
* <code>sudo visudo -f '''USERNAME'''</code>
then add the line
Defaults        timestamp_timeout='''30'''
where '''30''' is your preferred timeout (in minutes).
To always require a password, set it to '''0'''. To set an infinite timeout, set the value to be negative. (i.e.: '''-1''')
== Visually Improving the Terminal ==
* [[Bash - Changing the colours{{!}}Changing the colours in bash]]


[[Category:Linux]]
[[Category:Linux]]
[[Category:Knowledge]]
[[Category:Knowledge]]

Latest revision as of 16:54, 27 January 2022

This would be a good place to find simple & strange little tips for solving problems that tend to trip up new Linux users...

Files that don't exist

If you see "cannot stat 'randomfilename' That generally means the file doesn't exist.

Permission Frustrations

Unlike some other OSs, Linux is fairly consistant with permissions. But a lot of new users are easily confused by what required "root" access.

In general, pretty much any time you see "Permission denied", you can bypass it by adding "sudo" to the start of your command line, then providing your password.

BUT... stop & think about what you're trying to do first!