Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #261225

Re: Using the bash shell: determine if the root user used 'sudo -i'

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: Using the bash shell: determine if the root user used 'sudo -i'
Date 2023-08-27 01:30 +0200
Message-ID <H7aT7-4D2y-7@gated-at.bofh.it> (permalink)
References (1 earlier) <H72Cd-4xUZ-3@gated-at.bofh.it> <H73RD-4yAo-1@gated-at.bofh.it> <H73RD-4yAo-5@gated-at.bofh.it> <H741j-4yT0-11@gated-at.bofh.it> <H7azL-4CVP-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Aug 26, 2023 at 06:42:42PM -0400, Karl Vogel wrote:
> If you're running bash, the safest way to find your current working
> directory is capturing the output from /bin/pwd.  Symlinked directories
> can surprise you:
> 
>     me$ cd
> 
>     me$ ls -ldF today
>     lrwxr-xr-x  1 me mis   18 Aug 26 00:03 today@ -> notebook/2023/0826
> 
>     me$ cd today
> 
>     me$ pwd
>     /home/me/today
> 
>     me$ /bin/pwd
>     /home/me/notebook/2023/0826
> 
>     me$ echo $PWD
>     /home/me/today

unicorn:~$ help pwd
pwd: pwd [-LP]
    Print the name of the current working directory.
    
    Options:
      -L	print the value of $PWD if it names the current working
    		directory
      -P	print the physical directory, without any symbolic links
    
    By default, `pwd' behaves as if `-L' were specified.
    [...]

Of course, this is all a big tangent from the original request.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Using the bash shell: determine if the root user used 'sudo -i' Tom Browder <tom.browder@gmail.com> - 2023-08-26 16:30 +0200
  Re: Using the bash shell: determine if the root user used 'sudo -i' Roberto C. Sánchez <roberto@debian.org> - 2023-08-26 16:40 +0200
    Re: Using the bash shell: determine if the root user used 'sudo -i' Tom Browder <tom.browder@gmail.com> - 2023-08-26 18:00 +0200
      Re: Using the bash shell: determine if the root user used 'sudo -i' Greg Wooledge <greg@wooledge.org> - 2023-08-26 18:00 +0200
        Re: Using the bash shell: determine if the root user used 'sudo -i' Tom Browder <tom.browder@gmail.com> - 2023-08-26 18:10 +0200
          Re: Using the bash shell: determine if the root user used 'sudo -i' Nate Bargmann <n0nb@n0nb.us> - 2023-08-26 19:20 +0200
          Re: Using the bash shell: determine if the root user used 'sudo -i' Karl Vogel <vogelke@pobox.com> - 2023-08-27 01:10 +0200
            Re: Using the bash shell: determine if the root user used 'sudo -i' Greg Wooledge <greg@wooledge.org> - 2023-08-27 01:30 +0200
        Re: Using the bash shell: determine if the root user used 'sudo -i' Michael Kjörling <2695bd53d63c@ewoof.net> - 2023-08-26 18:20 +0200
        Re: Using the bash shell: determine if the root user used 'sudo -i' <tomas@tuxteam.de> - 2023-08-26 18:40 +0200
  Re: Using the bash shell: determine if the root user used 'sudo -i' Alain D D Williams <addw@phcomp.co.uk> - 2023-08-26 17:30 +0200
  Re: Using the bash shell: determine if the root user used 'sudo -i' <tomas@tuxteam.de> - 2023-08-26 17:50 +0200
    Re: Using the bash shell: determine if the root user used 'sudo -i' Tom Browder <tom.browder@gmail.com> - 2023-08-26 21:00 +0200
      Re: Using the bash shell: determine if the root user used 'sudo -i' tomas@tuxteam.de - 2023-08-26 21:20 +0200

csiph-web