jeudi 26 mars 2015

chown .bash_aliases


I need to append would be aliases to the .bash_aliases file through the echo command


For example I echoed this command echo 'cp -r .git ls | grep -v .gitignore ~/env/' >> ~/.bash_aliases to the .bash_aliases file and later created the alias alias uu=cp -r .git ls | grep -v .gitignore ~/env/ (note escape characters missing)


I was not able to echo onto the .bash_aliases file until I made the below permission changes:



sudo chmod 660 .bash_aliases
chown tech-ministry:tech-ministry .bash_aliases


The resulting permission changes:



-rw-r----- 1 tech-ministry tech-ministry 231 Mar 26 02:05 .bash_aliases


Previously the file was owned by root and I was unable to echo onto the .bash_aliases file as I was told I did not have sufficient privileges. I even tried with the sudo command, but I was still unable to append. Thus I changed permissions as stated.


Now whenever I open a terminal shell I see this:



bash: alias: -r: not found
bash: alias: .git: not found
bash: alias: 2my_comp.sh: not found
bash: alias: cron_vs_sudo.txt: not found
bash: alias: cust_packages.txt: not found
bash: alias: Desktop: not found
bash: alias: Documents: not found
bash: alias: Downloads: not found
bash: alias: env: not found
bash: alias: examples.desktop: not found
bash: alias: morning-ravine-7736: not found
bash: alias: Music: not found
bash: alias: my_computer.sh: not found
bash: alias: pack_me_in: not found
bash: alias: Pictures: not found
bash: alias: Public: not found
bash: alias: skype-install.deb: not found
bash: alias: Templates: not found
bash: alias: Videos: not found


I used chown to revise the permissions back to root:root and I sourced the file, but I still see the above 'bash: alias:' dump every time I open a terminal shell.


What have I done and how could I repair? Does the .bash_aliases file NEED to be root?



Aucun commentaire:

Enregistrer un commentaire