LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-02-2014, 08:08 PM   #31
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 12,541
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Member Response


Hi,

You can setup a '.bash_profile' & '.bashrc' to support user understandable alias that can be descriptive to that user. This can help with repeated commands along with 'history' to aid within sessions. Please notice 'll' & 'listlong' below to 'ls l'. By placing abbreviated alias you will have association to the command to be executed. Plus you can add path(s) to the alias when needed. Big plus; 'KISS' (Keep It Simple Stupid') is a good rule to follow. Do not make the alias to descriptive.
I let them modify to suit their session needs. I do restrict 'sudo' rights for security reasons. SuperUser on my systems are restricted to me and only me.

My house, my rules!
Code:
I like to provide my users with this;
sample .bash_profile;  

~$ cat .bash_profile
#-----------------cut-----------------  
# .bash_profile
#08-30-06 12:21

# Source .bashrc
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
#-----------------cut end--------------
Code:
 And this,
cat .bashrc
#-----------------cut-------------------

#.bashrc
#08-30-06 12:20

# Add bin to path
export PATH="$PATH:$HOME/bin"

# Dynamic resizing
shopt -s checkwinsize
#
#save bash history so as to share

shopt -s histappend
PROMPT_COMMAND='history -a'

# Custom prompt
#PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
#08-29-06 11:40 gws
if [ `id -un` = root ]; then
PS1='\[\033[1;31m\]\h:\w\$\[\033[0m\] '
else
PS1='\[\033[1;32m\]\h:\w\$\[\033[0m\] '
fi
#
# Add color
eval `dircolors -b`
#Terminus is a very nice Unicode font for the Linux console
#02-02-12 gws
#from dugan's site http://duganchen.ca/writings/slackware/fonts/

#04-30-12 11:41 removed
#
#if [ $TERM = "linux" ]; then
# setfont ter-v16n
#fi

# User defined aliases
alias cls='clear'
alias clls='clear; ls'
alias ll='ls -l'
alias listlong='ls -l'                        #Same as ll but enhance for understanding
alias lsa='ls -A'
alias lsg='ls | grep'
alias lsp='ls -1 /var/log/packages/ > package-list'
alias na='nano'
alias web='links -g -download-dir ~/ www.google.com'

#08-29-06 11:50

#To clean up and cover your tracks once you log off
#Depending on your version of BASH, you might have to use
# the other form of this command
 trap "rm -f ~$LOGNAME/.bash_history" 0

#The older KSH-style form
#trap 0 rm -f ~$LOGNAME/.bash_history
#-----------------cut end--------------
Agree that use will enhance experience as you work with the system. More than one way to skin a 'cat'.

Hope this helps.
 
1 members found this post helpful.
Old 04-04-2014, 08:00 AM   #32
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Sid. Arch. In the process of converting to and learning FreeBSD
Posts: 1,023
Blog Entries: 6

Rep: Reputation: 237Reputation: 237Reputation: 237
^ Nice post ^

Just wanted to add this, came across it the other day:

http://www.cyberciti.biz/tips/bash-a...inux-unix.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do you remember the commands used in Linux From Scratch? TheIndependentAquarius Linux From Scratch 5 04-21-2012 12:35 PM
LXer: 15 Ways Nokia’s N900 Is Better Than Apple’s iPhone (and 5 ways it’s not) LXer Syndicated Linux News 0 11-14-2009 09:20 AM
Cant remember my commands for linux! dracable Linux - Newbie 4 11-19-2006 08:10 AM
I cant remember all these Linux commands!! BajaNick General 7 04-05-2004 05:29 PM


All times are GMT -5. The time now is 02:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration