12517
12815
the exit status of COMMAND otherwise
12520
File: coreutils.info, Node: su invocation, Next: timeout invocation, Prev: stdbuf invocation, Up: Modified command invocation
12522
23.6 `su': Run a command with substitute user and group ID
12523
==========================================================
12525
`su' allows one user to temporarily become another user. It runs a
12526
command (often an interactive shell) with the real and effective user
12527
ID, group ID, and supplemental groups of a given USER. Synopsis:
12529
su [OPTION]... [USER [ARG]...]
12531
If no USER is given, the default is `root', the super-user. The
12532
shell to use is taken from USER's `passwd' entry, or `/bin/sh' if none
12533
is specified there. If USER has a password, `su' prompts for the
12534
password unless run by a user with effective user ID of zero (the
12537
By default, `su' does not change the current directory. It sets the
12538
environment variables `HOME' and `SHELL' from the password entry for
12539
USER, and if USER is not the super-user, sets `USER' and `LOGNAME' to
12540
USER. By default, the shell is not a login shell.
12542
Any additional ARGs are passed as additional arguments to the shell.
12544
GNU `su' does not treat `/bin/sh' or any other shells specially
12545
(e.g., by setting `argv[0]' to `-su', passing `-c' only to certain
12548
`su' can optionally be compiled to use `syslog' to report failed,
12549
and optionally successful, `su' attempts. (If the system supports
12550
`syslog'.) However, GNU `su' does not check if the user is a member of
12551
the `wheel' group; see below.
12553
The program accepts the following options. Also see *note Common
12557
`--command=COMMAND'
12558
Pass COMMAND, a single command line to run, to the shell with a
12559
`-c' option instead of starting an interactive shell.
12563
Pass the `-f' option to the shell. This probably only makes sense
12564
if the shell run is `csh' or `tcsh', for which the `-f' option
12565
prevents reading the startup file (`.cshrc'). With Bourne-like
12566
shells, the `-f' option disables file name pattern expansion
12567
(globbing), which is not likely to be useful.
12572
Make the shell a login shell. This means the following. Unset all
12573
environment variables except `TERM', `HOME', and `SHELL' (which
12574
are set as described above), and `USER' and `LOGNAME' (which are
12575
set, even for the super-user, as described above), and set `PATH'
12576
to a compiled-in default value. Change to USER's home directory.
12577
Prepend `-' to the shell's name, intended to make it read its
12578
login startup file(s).
12582
`--preserve-environment'
12583
Do not change the environment variables `HOME', `USER', `LOGNAME',
12584
or `SHELL'. Run the shell given in the environment variable
12585
`SHELL' instead of the shell from USER's passwd entry, unless the
12586
user running `su' is not the super-user and USER's shell is
12587
restricted. A "restricted shell" is one that is not listed in the
12588
file `/etc/shells', or in a compiled-in list if that file does not
12589
exist. Parts of what this option does can be overridden by
12590
`--login' and `--shell'.
12594
Run SHELL instead of the shell from USER's passwd entry, unless
12595
the user running `su' is not the super-user and USER's shell is
12596
restricted (see `-m' just above).
12601
125 if `su' itself fails
12602
126 if subshell is found but cannot be invoked
12603
127 if subshell cannot be found
12604
the exit status of the subshell otherwise
12606
23.6.1 Why GNU `su' does not support the `wheel' group
12607
------------------------------------------------------
12609
(This section is by Richard Stallman.)
12611
Sometimes a few of the users try to hold total power over all the
12612
rest. For example, in 1984, a few users at the MIT AI lab decided to
12613
seize power by changing the operator password on the Twenex system and
12614
keeping it secret from everyone else. (I was able to thwart this coup
12615
and give power back to the users by patching the kernel, but I wouldn't
12616
know how to do that in Unix.)
12618
However, occasionally the rulers do tell someone. Under the usual
12619
`su' mechanism, once someone learns the root password who sympathizes
12620
with the ordinary users, he or she can tell the rest. The "wheel
12621
group" feature would make this impossible, and thus cement the power of
12624
I'm on the side of the masses, not that of the rulers. If you are
12625
used to supporting the bosses and sysadmins in whatever they do, you
12626
might find this idea strange at first.
12629
File: coreutils.info, Node: timeout invocation, Prev: su invocation, Up: Modified command invocation
12631
23.7 `timeout': Run a command with a time limit
12818
File: coreutils.info, Node: timeout invocation, Prev: stdbuf invocation, Up: Modified command invocation
12820
23.6 `timeout': Run a command with a time limit
12632
12821
===============================================
12634
12823
`timeout' runs the given COMMAND and kills it if it is still running
17674
17934
* yottabyte, definition of: Block size. (line 131)
17675
17935
* Youmans, B.: Introduction. (line 19)
17676
17936
* zero-length string check: String tests. (line 15)
17677
* zettabyte, definition of: Block size. (line 123)
17937
* zettabyte, definition of: Block size. (line 124)
17678
17938
* |: Relations for expr. (line 11)
17684
Node: Introduction22187
17685
Node: Common options23746
17686
Node: Exit status27022
17687
Node: Backup options27773
17688
Node: Block size29697
17689
Node: Floating point34599
17690
Node: Signal specifications36009
17691
Node: Disambiguating names and IDs38063
17692
Ref: Disambiguating names and IDs-Footnote-139632
17693
Node: Random sources39702
17694
Node: Target directory41319
17695
Node: Trailing slashes44804
17696
Node: Traversing symlinks45825
17697
Node: Treating / specially46898
17698
Node: Special built-in utilities48445
17699
Node: Standards conformance49580
17700
Node: Output of entire files51136
17701
Node: cat invocation51737
17702
Node: tac invocation53544
17703
Node: nl invocation54806
17704
Node: od invocation58685
17705
Node: base64 invocation65556
17706
Node: Formatting file contents66935
17707
Node: fmt invocation67386
17708
Node: pr invocation70199
17709
Node: fold invocation82656
17710
Node: Output of parts of files84116
17711
Node: head invocation84613
17712
Node: tail invocation86798
17713
Node: split invocation96098
17714
Node: csplit invocation101961
17715
Node: Summarizing files106766
17716
Node: wc invocation107414
17717
Node: sum invocation110488
17718
Node: cksum invocation111893
17719
Node: md5sum invocation113033
17720
Node: sha1sum invocation118128
17721
Node: sha2 utilities118908
17722
Node: Operating on sorted files119532
17723
Node: sort invocation120119
17724
Ref: sort invocation-Footnote-1144047
17725
Node: shuf invocation144599
17726
Node: uniq invocation147178
17727
Node: comm invocation151870
17728
Node: ptx invocation154291
17729
Node: General options in ptx157095
17730
Node: Charset selection in ptx157676
17731
Node: Input processing in ptx158578
17732
Node: Output formatting in ptx163999
17733
Node: Compatibility in ptx170565
17734
Node: tsort invocation173798
17735
Node: tsort background176957
17736
Node: Operating on fields178605
17737
Node: cut invocation178967
17738
Node: paste invocation182924
17739
Node: join invocation184238
17740
Node: Operating on characters190589
17741
Node: tr invocation191011
17742
Node: Character sets192729
17743
Node: Translating197247
17744
Node: Squeezing199338
17745
Node: expand invocation202405
17746
Node: unexpand invocation203887
17747
Node: Directory listing205705
17748
Node: ls invocation206191
17749
Ref: ls invocation-Footnote-1208287
17750
Node: Which files are listed208509
17751
Node: What information is listed212249
17752
Node: Sorting the output221496
17753
Node: Details about version sort223806
17754
Node: General output formatting225574
17755
Node: Formatting file timestamps230198
17756
Node: Formatting the file names235524
17757
Node: dir invocation238440
17758
Node: vdir invocation238851
17759
Node: dircolors invocation239229
17760
Node: Basic operations240927
17761
Node: cp invocation241547
17762
Node: dd invocation257656
17763
Node: install invocation268514
17764
Node: mv invocation273789
17765
Node: rm invocation278351
17766
Node: shred invocation282655
17767
Node: Special file types290687
17768
Node: link invocation292193
17769
Node: ln invocation293412
17770
Node: mkdir invocation301204
17771
Node: mkfifo invocation303575
17772
Node: mknod invocation304695
17773
Node: readlink invocation306827
17774
Node: rmdir invocation308798
17775
Node: unlink invocation310072
17776
Node: Changing file attributes311031
17777
Node: chown invocation311845
17778
Node: chgrp invocation318031
17779
Node: chmod invocation321081
17780
Node: touch invocation323836
17781
Node: Disk usage329690
17782
Node: df invocation330351
17783
Node: du invocation336293
17784
Node: stat invocation344825
17785
Node: sync invocation350322
17786
Node: truncate invocation351277
17787
Node: Printing text353047
17788
Node: echo invocation353421
17789
Node: printf invocation356007
17790
Node: yes invocation361478
17791
Node: Conditions362090
17792
Node: false invocation362681
17793
Node: true invocation363716
17794
Node: test invocation364995
17795
Node: File type tests367040
17796
Node: Access permission tests367922
17797
Node: File characteristic tests368807
17798
Node: String tests369572
17799
Node: Numeric tests370311
17800
Node: Connectives for test371117
17801
Node: expr invocation371470
17802
Node: String expressions373911
17803
Node: Numeric expressions376495
17804
Node: Relations for expr377192
17805
Node: Examples of expr378386
17806
Node: Redirection379110
17807
Node: tee invocation379568
17808
Node: File name manipulation384358
17809
Node: basename invocation384874
17810
Node: dirname invocation386321
17811
Node: pathchk invocation387759
17812
Node: mktemp invocation389523
17813
Node: Working context395143
17814
Node: pwd invocation395787
17815
Node: stty invocation397133
17816
Node: Control399893
17818
Node: Output402326
17820
Node: Combination405228
17821
Node: Characters407449
17822
Node: Special409003
17823
Node: printenv invocation410660
17824
Node: tty invocation411670
17825
Node: User information412376
17826
Node: id invocation413011
17827
Node: logname invocation414934
17828
Node: whoami invocation415561
17829
Node: groups invocation416048
17830
Node: users invocation417253
17831
Node: who invocation418200
17832
Node: System context421136
17833
Node: date invocation421801
17834
Node: Time conversion specifiers423518
17835
Node: Date conversion specifiers425998
17836
Node: Literal conversion specifiers429122
17837
Node: Padding and other flags429480
17838
Node: Setting the time431671
17839
Node: Options for date432677
17840
Node: Examples of date436153
17841
Ref: %s-examples437571
17842
Node: arch invocation439756
17843
Node: nproc invocation440205
17844
Node: uname invocation441315
17845
Node: hostname invocation443889
17846
Node: hostid invocation444502
17847
Node: uptime invocation445213
17848
Node: SELinux context446336
17849
Node: chcon invocation446711
17850
Node: runcon invocation448533
17851
Node: Modified command invocation449999
17852
Node: chroot invocation450749
17853
Ref: chroot invocation-Footnote-1453317
17854
Node: env invocation453619
17855
Node: nice invocation457863
17856
Node: nohup invocation461579
17857
Node: stdbuf invocation463862
17858
Node: su invocation466384
17859
Node: timeout invocation470885
17860
Node: Process control473082
17861
Node: kill invocation473305
17862
Node: Delaying476378
17863
Node: sleep invocation476575
17864
Node: Numeric operations477676
17865
Node: factor invocation478008
17866
Node: seq invocation479753
17867
Node: File permissions483373
17868
Node: Mode Structure483991
17869
Node: Symbolic Modes487686
17870
Node: Setting Permissions488784
17871
Node: Copying Permissions491397
17872
Node: Changing Special Mode Bits492216
17873
Node: Conditional Executability494038
17874
Node: Multiple Changes494582
17875
Node: Umask and Protection496249
17876
Node: Numeric Modes497354
17877
Node: Directory Setuid and Setgid499254
17878
Node: Date input formats501516
17879
Node: General date syntax503947
17880
Node: Calendar date items506938
17881
Node: Time of day items508943
17882
Node: Time zone items511147
17883
Node: Combined date and time of day items512407
17884
Node: Day of week items513139
17885
Node: Relative items in date strings514156
17886
Node: Pure numbers in date strings516966
17887
Node: Seconds since the Epoch517955
17888
Node: Specifying time zone rules519584
17889
Node: Authors of parse_datetime521964
17890
Ref: Authors of get_date522151
17891
Node: Opening the software toolbox523114
17892
Node: Toolbox introduction523786
17893
Node: I/O redirection526509
17894
Node: The who command529343
17895
Node: The cut command530240
17896
Node: The sort command531303
17897
Node: The uniq command532007
17898
Node: Putting the tools together532697
17899
Ref: Putting the tools together-Footnote-1544649
17900
Node: GNU Free Documentation License544723
17901
Node: Concept index569916
17944
Node: Introduction22145
17945
Node: Common options23704
17946
Node: Exit status26980
17947
Node: Backup options27725
17948
Node: Block size29649
17949
Node: Floating point34503
17950
Node: Signal specifications35913
17951
Node: Disambiguating names and IDs37968
17952
Ref: Disambiguating names and IDs-Footnote-139537
17953
Node: Random sources39607
17954
Node: Target directory41224
17955
Node: Trailing slashes44709
17956
Node: Traversing symlinks45730
17957
Node: Treating / specially46803
17958
Node: Special built-in utilities48350
17959
Node: Standards conformance49485
17960
Node: Output of entire files51041
17961
Node: cat invocation51642
17962
Node: tac invocation53449
17963
Node: nl invocation54711
17964
Node: od invocation58590
17965
Node: base64 invocation65461
17966
Node: Formatting file contents66840
17967
Node: fmt invocation67291
17968
Node: pr invocation70167
17969
Node: fold invocation82609
17970
Node: Output of parts of files84069
17971
Node: head invocation84566
17972
Node: tail invocation86751
17973
Node: split invocation96051
17974
Node: csplit invocation102972
17975
Node: Summarizing files107777
17976
Node: wc invocation108425
17977
Node: sum invocation111499
17978
Node: cksum invocation112904
17979
Node: md5sum invocation114044
17980
Node: sha1sum invocation119663
17981
Node: sha2 utilities120443
17982
Node: Operating on sorted files121067
17983
Node: sort invocation121654
17984
Ref: sort invocation-Footnote-1145583
17985
Node: shuf invocation146135
17986
Node: uniq invocation148715
17987
Node: comm invocation153408
17988
Node: ptx invocation155829
17989
Node: General options in ptx158629
17990
Node: Charset selection in ptx159210
17991
Node: Input processing in ptx160112
17992
Node: Output formatting in ptx165528
17993
Node: Compatibility in ptx172094
17994
Node: tsort invocation175328
17995
Node: tsort background178487
17996
Node: Operating on fields180135
17997
Node: cut invocation180497
17998
Node: paste invocation184454
17999
Node: join invocation185768
18000
Node: Operating on characters192121
18001
Node: tr invocation192543
18002
Node: Character sets194261
18003
Node: Translating198779
18004
Node: Squeezing200870
18005
Node: expand invocation203937
18006
Node: unexpand invocation205419
18007
Node: Directory listing207237
18008
Node: ls invocation207723
18009
Ref: ls invocation-Footnote-1209819
18010
Node: Which files are listed210041
18011
Node: What information is listed213781
18012
Node: Sorting the output223028
18013
Node: Details about version sort225338
18014
Node: General output formatting227106
18015
Node: Formatting file timestamps232096
18016
Node: Formatting the file names237422
18017
Node: dir invocation240338
18018
Node: vdir invocation240749
18019
Node: dircolors invocation241127
18020
Node: Basic operations242826
18021
Node: cp invocation243446
18022
Node: dd invocation259668
18023
Node: install invocation272756
18024
Node: mv invocation278031
18025
Node: rm invocation282593
18026
Node: shred invocation286987
18027
Node: Special file types295023
18028
Node: link invocation296529
18029
Node: ln invocation297748
18030
Node: mkdir invocation305803
18031
Node: mkfifo invocation308174
18032
Node: mknod invocation309294
18033
Node: readlink invocation311426
18034
Node: rmdir invocation313385
18035
Node: unlink invocation314659
18036
Node: Changing file attributes315618
18037
Node: chown invocation316432
18038
Node: chgrp invocation322593
18039
Node: chmod invocation325668
18040
Node: touch invocation328423
18041
Node: Disk usage335827
18042
Node: df invocation336488
18043
Node: du invocation342674
18044
Node: stat invocation351207
18045
Node: sync invocation356720
18046
Node: truncate invocation357675
18047
Node: Printing text359446
18048
Node: echo invocation359820
18049
Node: printf invocation362406
18050
Node: yes invocation367877
18051
Node: Conditions368489
18052
Node: false invocation369080
18053
Node: true invocation370115
18054
Node: test invocation371394
18055
Node: File type tests373439
18056
Node: Access permission tests374321
18057
Node: File characteristic tests375206
18058
Node: String tests375971
18059
Node: Numeric tests376710
18060
Node: Connectives for test377516
18061
Node: expr invocation377869
18062
Node: String expressions380310
18063
Node: Numeric expressions382894
18064
Node: Relations for expr383591
18065
Node: Examples of expr384785
18066
Node: Redirection385510
18067
Node: tee invocation385968
18068
Node: File name manipulation390758
18069
Node: basename invocation391333
18070
Node: dirname invocation393311
18071
Node: pathchk invocation394906
18072
Node: mktemp invocation396670
18073
Node: realpath invocation402318
18074
Node: Working context405123
18075
Node: pwd invocation405767
18076
Node: stty invocation407113
18077
Node: Control409873
18079
Node: Output412307
18081
Node: Combination415210
18082
Node: Characters417431
18083
Node: Special418985
18084
Node: printenv invocation420642
18085
Node: tty invocation421653
18086
Node: User information422359
18087
Node: id invocation422994
18088
Node: logname invocation424917
18089
Node: whoami invocation425544
18090
Node: groups invocation426031
18091
Node: users invocation427236
18092
Node: who invocation428183
18093
Node: System context431119
18094
Node: date invocation431784
18095
Node: Time conversion specifiers433501
18096
Node: Date conversion specifiers435924
18097
Node: Literal conversion specifiers438960
18098
Node: Padding and other flags439318
18099
Node: Setting the time441509
18100
Node: Options for date442630
18101
Node: Examples of date446929
18102
Ref: %s-examples448347
18103
Node: arch invocation451511
18104
Node: nproc invocation451960
18105
Node: uname invocation453070
18106
Node: hostname invocation455647
18107
Node: hostid invocation456260
18108
Node: uptime invocation456971
18109
Node: SELinux context458094
18110
Node: chcon invocation458469
18111
Node: runcon invocation460291
18112
Node: Modified command invocation461757
18113
Node: chroot invocation462449
18114
Ref: chroot invocation-Footnote-1465017
18115
Node: env invocation465319
18116
Node: nice invocation469564
18117
Node: nohup invocation473285
18118
Node: stdbuf invocation475568
18119
Node: timeout invocation478095
18120
Node: Process control480343
18121
Node: kill invocation480566
18122
Node: Delaying483636
18123
Node: sleep invocation483833
18124
Node: Numeric operations484934
18125
Node: factor invocation485266
18126
Node: seq invocation487024
18127
Node: File permissions490804
18128
Node: Mode Structure491496
18129
Node: Symbolic Modes495191
18130
Node: Setting Permissions496289
18131
Node: Copying Permissions498902
18132
Node: Changing Special Mode Bits499721
18133
Node: Conditional Executability501543
18134
Node: Multiple Changes502087
18135
Node: Umask and Protection503754
18136
Node: Numeric Modes504859
18137
Node: Operator Numeric Modes506985
18138
Node: Directory Setuid and Setgid508001
18139
Node: Date input formats510828
18140
Node: General date syntax513259
18141
Node: Calendar date items516250
18142
Node: Time of day items518255
18143
Node: Time zone items520459
18144
Node: Combined date and time of day items521719
18145
Node: Day of week items522451
18146
Node: Relative items in date strings523468
18147
Node: Pure numbers in date strings526278
18148
Node: Seconds since the Epoch527267
18149
Node: Specifying time zone rules528896
18150
Node: Authors of parse_datetime531276
18151
Ref: Authors of get_date531463
18152
Node: Opening the software toolbox532426
18153
Node: Toolbox introduction533193
18154
Node: I/O redirection535916
18155
Node: The who command538750
18156
Node: The cut command539647
18157
Node: The sort command540710
18158
Node: The uniq command541414
18159
Node: Putting the tools together542104
18160
Ref: Putting the tools together-Footnote-1554056
18161
Node: GNU Free Documentation License554130
18162
Node: Concept index579323
17903
18164
End Tag Table