Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Muppet Newbie terminal command questions

  • 22-04-2004 02:48PM
    #1
    Registered Users, Registered Users 2 Posts: 2,323 ✭✭✭


    Guys i've been searching the web looking for these commands but i cant find them so i'm hoping someone here can help.

    1) How do you display the PATH and ls -l commands in a more "user friendly" way? such as permissions and mod times etc

    2) How do i display a summary of disk usage for each diretory argument? I will figure out how to format in bytes KB and Mb myself. Also does that imply that the user must enter a diretory?

    And the most embarassing one of all.......

    3)What arguments of the who command only show those in your group?

    Cheers

    daz


Comments

  • Closed Accounts Posts: 6,601 ✭✭✭Kali


    1) don't quite know what you mean.. if you mean a file explorer type interface, have a look at installing "midnight commander" .. otherwise pipe the output of ls to sort (ls -al |sort) and if you want to display the path then have a look at simply editing your prompt to include the current path (have a look in .bashrc .zshrc or .cshrc depending on what shell you are running)...

    2) du -k

    3) no idea offhand.. i cant recall any switch for w/who or finger that displays users groups.


  • Closed Accounts Posts: 484 ✭✭ssh


    You aren't by any chance in 2nd year CS in DIT, are you? :-)

    1)
    echo $PATH | sed 's/:/\
    /g' | while read line; do
    ls -plahd $line
    done

    2) du -h will tell you the usage of a directory, the -h makes the numbers more readable.

    3) they don't exist. You need to use groups command to find which groups you are in, one per line, preferably.

    then
    who | cut -d " " -f 1 |
    while read user; do
    groups $user | grep ${mygroup[0]}....
    done

    that won't work, coz it's incomplete, but that's the general idea.


  • Registered Users, Registered Users 2 Posts: 2,323 ✭✭✭Q_Ball


    hehe yeah. Its due in tomorrow and i have most of it done, backtitles turned out to be a piece of cake its just these last ones that i couldnt get


Advertisement