Welcome to the Linux Foundation Forum!

Can't view cwd, environ, mem or status fields


Hi there,

I'm going through Lab 2.2 and can view the contents of cmdline inside a process (1177) in the /proc directory but Can't view cwd, environ, mem or status fields. I'm using the cat command, should I use another command or is not seeing the contents the point of the exercise?


  • coop
    coop Posts: 915

    Depending which process you are looking at, you may need to use sudo, For a process I own:

    q8:/proc/5093>cat environ

    q8:/proc/5093>ls -l cwd
    lrwxrwxrwx 1 coop coop 0 Feb 25 08:12 cwd -> /usr/local/coop8
    (cwd is always a symbolic link to a directory, so you cannot "cat" it.

    mem is never viewable, it is used for binary read and writes, don't mess with it.\

    q8:/proc/5093>cat status
    Name: dbus-daemon
    Umask: 0022
    State: S (sleeping)
    Tgid: 5093

    ( a long listing)

    I suspect you tried to look at a process that is not yours and so the s

  • coop
    coop Posts: 915

    I got cut off. Check if the process is yours, I suspect it is not and you have to do sudo to look at it

  • luisviveropena


    As Coop said, it would be related to permissions, as in this case:

    luis@starseedstation:/proc$ ls -F 18
    ls: cannot read symbolic link '18/cwd': Permission denied
    ls: cannot read symbolic link '18/root': Permission denied
    ls: cannot read symbolic link '18/exe': Permission denied
    arch_status coredump_filter io mountstats patch_state smaps timers
    attr/ cpuset limits net/ personality smaps_rollup timerslack_ns
    autogroup cwd@ loginuid ns/ projid_map stack uid_map
    auxv environ map_files/ numa_maps root@ stat wchan
    cgroup exe@ maps oom_adj sched statm
    clear_refs fd/ mem oom_score schedstat status
    cmdline fdinfo/ mountinfo oom_score_adj sessionid syscall
    comm gid_map mounts pagemap setgroups task/

    As you see, I'm getting some "Permission denied" messages with a non-privileged user.


  • owengrantham

    Thanks, Coop and Luis. I see why I couldn't view these field now.
    Much appreciated.

  • luisviveropena
    luisviveropena Posts: 1,173

    It's a pleasure!



Upcoming Training