WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] How to make aliases permanent in Tiny Core Linux?  (Read 7638 times)

Offline Adam

  • Full Member
  • ***
  • Posts: 121
[SOLVED] How to make aliases permanent in Tiny Core Linux?
« on: July 31, 2013, 04:27:15 PM »
Hi all, please advise as I can't find bashrc file in Tiny Core Linux.

Quote
root@box:/# find / -name bashrc
root@box:/# find / -name bash
root@box:/#

Reference:
http://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html
http://firewallengineer.wordpress.com/2013/08/02/problem-how-to-make-aliases-permanent-in-tiny-core-linux/
« Last Edit: August 18, 2013, 02:06:10 AM by Adam »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: How to make aliases permanent in Tiny Core Linux?
« Reply #1 on: July 31, 2013, 04:59:49 PM »
I'm using ~/.ashrc.
Download a copy and keep it handy: Core book ;)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to make aliases permanent in Tiny Core Linux?
« Reply #2 on: July 31, 2013, 11:52:11 PM »
Did you load the bash extension?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Adam

  • Full Member
  • ***
  • Posts: 121
Re: How to make aliases permanent in Tiny Core Linux?
« Reply #3 on: August 01, 2013, 03:43:18 PM »
I'm using ~/.ashrc.

I would appreciate if you could share how to use this?
I can't even find it in my TC

Quote
root@box:~# find / -name ashrc
root@box:~#

Offline Adam

  • Full Member
  • ***
  • Posts: 121
Re: How to make aliases permanent in Tiny Core Linux?
« Reply #4 on: August 01, 2013, 03:44:06 PM »
Did you load the bash extension?

Thanks for your advise. May I know how to load the bash extension?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to make aliases permanent in Tiny Core Linux?
« Reply #5 on: August 01, 2013, 04:10:34 PM »
http://forum.tinycorelinux.net/index.php/topic,7495.0.html

Please read documentation and spend time with wiki, particularly about basics like persistence, extensions and basic configuration, and also explore all included system tools to get more familiar with the environment.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: How to make aliases permanent in Tiny Core Linux?
« Reply #6 on: August 01, 2013, 05:38:08 PM »
Hi Adam
The files you seek are hidden. Try:
Code: [Select]
ls -la ~/.*rcThe filenames begin with a period which makes them hidden files.

Offline Adam

  • Full Member
  • ***
  • Posts: 121
Re: How to make aliases permanent in Tiny Core Linux?
« Reply #7 on: August 12, 2013, 12:14:36 AM »
Hi Adam
The files you seek are hidden. Try:
Code: [Select]
ls -la ~/.*rcThe filenames begin with a period which makes them hidden files.

Thanks again Rich, but there is No such file or directory
Code: [Select]
root@box:~# ls -la ~/.*rc
ls: /root/.*rc: No such file or directory
root@box:~#

Update:
Sorry  I was looking at the wrong directory

Code: [Select]
root@box:~# find / -name .*ashrc
/home/tc/.ashrc
/etc/skel/.ashrc
root@box:~#

Code: [Select]
tc@box:~$ pwd
/home/tc
tc@box:~$ ls -la ~/.*rc
-rw-r--r--    1 tc       staff          476 Aug 12 08:53 /home/tc/.ashrc
tc@box:~$
« Last Edit: August 12, 2013, 01:56:40 AM by Adam »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to make aliases permanent in Tiny Core Linux?
« Reply #8 on: August 12, 2013, 02:51:59 AM »
Using "~/" as root is ambiguous.

I suggest using a file manager to get familiar with the system.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Adam

  • Full Member
  • ***
  • Posts: 121
Re: How to make aliases permanent in Tiny Core Linux?
« Reply #9 on: August 12, 2013, 03:50:25 AM »
I’ve just found something new. By default, alias is working with tc id whiles doesn’t with root id. Please let me know how to load these alias setting in root as well.

Code: [Select]
tc@box:~$ alias
ls='ls -p'
cp='cp -i'
c='clear'
df='df -h'
reboot='sudo reboot'
rm='rm -i'
mv='mv -i'
la='ls -la'
du='du -h'
d='dmenu_run &'
ce='cd /etc/sysconfig/tcedir'
i='ifconfig | grep dd'
ll='ls -l'
tc@box:~$

Code: [Select]
tc@box:~$ sudo su
root@box:~# alias
root@box:~#

Code: [Select]
tc@box:~$ ls -la
total 12
drwxrws---    3 tc       staff          120 Aug 12 06:29 ./
drwxrwxr-x    3 root     staff           60 Mar  4  2010 ../
-rw-rw-r--    1 tc       staff         2216 Aug 12 06:38 .ash_history
-rw-r--r--    1 tc       staff          517 Aug 12 05:46 .ashrc
drwxr-sr-x    3 tc       staff           60 Aug 12 06:29 .local/
-rw-rw-r--    1 tc       staff          920 May  5 21:57 .profile
tc@box:~$

Code: [Select]
tc@box:~$ cat .ashrc
# ~/.ashrc: Executed by SHells.
#
. /etc/init.d/tc-functions
if [ -n "$DISPLAY" ]
then
        `which editor >/dev/null` && EDITOR=editor || EDITOR=vi
else
        EDITOR=vi
fi
export EDITOR

# Alias definitions.
#
alias df='df -h'
alias du='du -h'

alias ls='ls -p'
alias ll='ls -l'
alias la='ls -la'

alias i='ifconfig | grep dd'
alias c=clear
alias reboot='sudo reboot'

# Avoid errors... use -f to skip confirmation.
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'

alias d='dmenu_run &'
alias ce='cd /etc/sysconfig/tcedir'
tc@box:~$

Code: [Select]
root@box:~# cd ~
root@box:~# pwd
/root
root@box:~# ls -al
total 12
drwxrwxr-x    2 root     staff          100 Aug 12 06:33 .
drwxrwxr-x   17 root     staff          360 Dec 21  2012 ..
-rw-rw-r--    1 root     staff          248 Mar  4  2010 .Xdefaults
-rw-------    1 root     root            83 Aug 12 06:35 .ash_history
-rw-rw-r--    1 root     staff          278 Aug 20  2012 .profile
root@box:~#

I’ve also found that there is no .ashrc file in root. Should I create one to fix this issue?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to make aliases permanent in Tiny Core Linux?
« Reply #10 on: August 13, 2013, 07:00:14 PM »
Code: [Select]
su -p
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Adam

  • Full Member
  • ***
  • Posts: 121
Re: How to make aliases permanent in Tiny Core Linux?
« Reply #11 on: August 16, 2013, 03:00:27 AM »
Code: [Select]
su -p

Superb  8)
Code: [Select]
tc@Core3:~$ sudo su
root@Core3:~# alias
root@Core3:~# su -p
root@Core3:~# alias
root@Core3:~# exit
root@Core3:~# exit
tc@Core3:~$ su -p
Password:
root@Core3:~# alias
ls='ls -p'
cp='cp -i'
td='sudo tcpdump -i 2 -n'
c='clear'
df='df -h'
tcpdump='sudo tcpdump'