Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

Setting up an alias containing single and double quotes

SOLVED
Go to solution
Mr Peter Kempner
Occasional Contributor

Setting up an alias containing single and double quotes

I am trying without success to alias the following command:

ll -t * |awk {'printf "%-4s%-3s%-10s%s\n", $6, $7, $8, $9'}|head

I have tried everything I can think of to cope with the quotes in the command but to no avail. Surely there is a way ....
2 REPLIES
Robin Wakefield
Honored Contributor
Solution

Re: Setting up an alias containing single and double quotes

alias lt='ll -t * |awk "{printf \"%-4s%-3s%-10s%s\n\", \$6, \$7, \$8, \$9}"|head'

should work.

Robin
federico_3
Honored Contributor

Re: Setting up an alias containing single and double quotes

try like thi":
alias llt="ll -t * | awk '{printf \"%-4s%-3s%-10s%s\n\", \$6,\$7,\$8,\$9}'| head "