Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Fedora - How to check current user?
New Posts  All Forums:Forum Nav:

Fedora - How to check current user?

post #1 of 5
Thread Starter 
Hey guys, It's pretty simple but I'm stumped.

I want to display current user logged on. I want the message to say

"Hello <username>, Welcome to the server."

I assume I use a variable but I just can't find what it is?
Cashcow
(13 items)
 
   
CPUMotherboardGraphicsRAM
Phenom II 955 | C3 | 4GHz MSI | 790FX | GD70 MSI | GTX570 1.25GB G.Skill | Ripjaws | 4GB | 1600MHz 
Hard DriveOptical DriveOSMonitor
60GB Corsair F3 | Caviar Black1TB Lite-On | Blu-Ray Windows | 7 | Ultimate Sony Bravia | EX500 46" 
KeyboardPowerCaseMouse
Razer Lycosa Corsair | TX650W Corsair Obsidian | 800D Razer Death Adder 
Mouse Pad
Razer Goliathus 
CPUGraphicsRAMHard Drive
1.2GHz Exynos SoC Mali-400 MP 1GB 16GB Flash storage 
OSMonitorPower
Android 3.2.7 (CriskelloROM Variant)  4.3" Super AMOLED+ Display 1650ma Battery 
CPUGraphicsRAMHard Drive
i5-2557M Dual-core 1.7ghz Intel HD3000 386mb 4G 1333mhz 128gb Intel SSD 
OSMonitorKeyboardCase
Mac OSX Lion 13.3" 1440x900 LED Backlit  Unibody  
  hide details  
Reply
Cashcow
(13 items)
 
   
CPUMotherboardGraphicsRAM
Phenom II 955 | C3 | 4GHz MSI | 790FX | GD70 MSI | GTX570 1.25GB G.Skill | Ripjaws | 4GB | 1600MHz 
Hard DriveOptical DriveOSMonitor
60GB Corsair F3 | Caviar Black1TB Lite-On | Blu-Ray Windows | 7 | Ultimate Sony Bravia | EX500 46" 
KeyboardPowerCaseMouse
Razer Lycosa Corsair | TX650W Corsair Obsidian | 800D Razer Death Adder 
Mouse Pad
Razer Goliathus 
CPUGraphicsRAMHard Drive
1.2GHz Exynos SoC Mali-400 MP 1GB 16GB Flash storage 
OSMonitorPower
Android 3.2.7 (CriskelloROM Variant)  4.3" Super AMOLED+ Display 1650ma Battery 
CPUGraphicsRAMHard Drive
i5-2557M Dual-core 1.7ghz Intel HD3000 386mb 4G 1333mhz 128gb Intel SSD 
OSMonitorKeyboardCase
Mac OSX Lion 13.3" 1440x900 LED Backlit  Unibody  
  hide details  
Reply
post #2 of 5
echo "Hello `whoami` and welcome! Please don't rm -rf /"
Kinda meh now...
(13 items)
 
  
CPUMotherboardGraphicsRAM
PhII 940 BE asus M4N82 Deluxe 2x 8800gts(g92) 2x 1g ocz ddr2 1066 
Hard DriveOptical DriveOSMonitor
/dev/sd[abc] /dev/sr0 WinXP/Linux 22in acer 
PowerCaseMouseMouse Pad
950w rosewill timebomb Antec 900 (2small) Voodoo Deathadder (RED!) X-Trac Pads Ripper XL 
  hide details  
Reply
Kinda meh now...
(13 items)
 
  
CPUMotherboardGraphicsRAM
PhII 940 BE asus M4N82 Deluxe 2x 8800gts(g92) 2x 1g ocz ddr2 1066 
Hard DriveOptical DriveOSMonitor
/dev/sd[abc] /dev/sr0 WinXP/Linux 22in acer 
PowerCaseMouseMouse Pad
950w rosewill timebomb Antec 900 (2small) Voodoo Deathadder (RED!) X-Trac Pads Ripper XL 
  hide details  
Reply
post #3 of 5
who | awk '{print $1}'

Also, wall is nice to use to send message when you want to do maintenance.
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
post #4 of 5
Quote:
Originally Posted by EntTheGod View Post
echo "Hello `whoami` and welcome! Please don't rm -rf /"
Lol. how many of us have accidentally done that?

*raises hand*
Gene-Z Dedi
(7 items)
 
Captain America
(6 items)
 
 
CPUMotherboardRAMHard Drive
i7 2600k @ 5.2 Ghz Asus Maximus IV Gene-Z Gskill 2133 4GB Caviar Black 
CoolingOSPower
Corsair H100 Arch x64 OCZ 650 Watt 
CPUCPUMotherboardGraphics
Intel Xeon E5-2650 Intel Xeon E5-2650 ASUS Z9PE-D8 WS XFX 6870 
RAMOS
32 GB Samsung Arch Nix 
  hide details  
Reply
Gene-Z Dedi
(7 items)
 
Captain America
(6 items)
 
 
CPUMotherboardRAMHard Drive
i7 2600k @ 5.2 Ghz Asus Maximus IV Gene-Z Gskill 2133 4GB Caviar Black 
CoolingOSPower
Corsair H100 Arch x64 OCZ 650 Watt 
CPUCPUMotherboardGraphics
Intel Xeon E5-2650 Intel Xeon E5-2650 ASUS Z9PE-D8 WS XFX 6870 
RAMOS
32 GB Samsung Arch Nix 
  hide details  
Reply
post #5 of 5
Thread Starter 
Thanks guys! you're the best!
Cashcow
(13 items)
 
   
CPUMotherboardGraphicsRAM
Phenom II 955 | C3 | 4GHz MSI | 790FX | GD70 MSI | GTX570 1.25GB G.Skill | Ripjaws | 4GB | 1600MHz 
Hard DriveOptical DriveOSMonitor
60GB Corsair F3 | Caviar Black1TB Lite-On | Blu-Ray Windows | 7 | Ultimate Sony Bravia | EX500 46" 
KeyboardPowerCaseMouse
Razer Lycosa Corsair | TX650W Corsair Obsidian | 800D Razer Death Adder 
Mouse Pad
Razer Goliathus 
CPUGraphicsRAMHard Drive
1.2GHz Exynos SoC Mali-400 MP 1GB 16GB Flash storage 
OSMonitorPower
Android 3.2.7 (CriskelloROM Variant)  4.3" Super AMOLED+ Display 1650ma Battery 
CPUGraphicsRAMHard Drive
i5-2557M Dual-core 1.7ghz Intel HD3000 386mb 4G 1333mhz 128gb Intel SSD 
OSMonitorKeyboardCase
Mac OSX Lion 13.3" 1440x900 LED Backlit  Unibody  
  hide details  
Reply
Cashcow
(13 items)
 
   
CPUMotherboardGraphicsRAM
Phenom II 955 | C3 | 4GHz MSI | 790FX | GD70 MSI | GTX570 1.25GB G.Skill | Ripjaws | 4GB | 1600MHz 
Hard DriveOptical DriveOSMonitor
60GB Corsair F3 | Caviar Black1TB Lite-On | Blu-Ray Windows | 7 | Ultimate Sony Bravia | EX500 46" 
KeyboardPowerCaseMouse
Razer Lycosa Corsair | TX650W Corsair Obsidian | 800D Razer Death Adder 
Mouse Pad
Razer Goliathus 
CPUGraphicsRAMHard Drive
1.2GHz Exynos SoC Mali-400 MP 1GB 16GB Flash storage 
OSMonitorPower
Android 3.2.7 (CriskelloROM Variant)  4.3" Super AMOLED+ Display 1650ma Battery 
CPUGraphicsRAMHard Drive
i5-2557M Dual-core 1.7ghz Intel HD3000 386mb 4G 1333mhz 128gb Intel SSD 
OSMonitorKeyboardCase
Mac OSX Lion 13.3" 1440x900 LED Backlit  Unibody  
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Fedora - How to check current user?