Close Menu
  • Analog Design
    • Latest Analog Layout Interview Questions (2025)
  • Digital Design
    • Digital Electronics Interview Question(2025)
    • Top VLSI Interview Questions
  • Physical Design
    • Physical Design Interview Questions for VLSI Engineers
  • Verilog
    • Verilog Interview Questions(2024)
  • Forum
Facebook Instagram YouTube LinkedIn WhatsApp
SiliconvlsiSiliconvlsi
Forum Questions Register in Forum Login in Forum
Facebook Instagram YouTube LinkedIn WhatsApp
  • Analog Design
    • Latest Analog Layout Interview Questions (2025)
  • Digital Design
    • Digital Electronics Interview Question(2025)
    • Top VLSI Interview Questions
  • Physical Design
    • Physical Design Interview Questions for VLSI Engineers
  • Verilog
    • Verilog Interview Questions(2024)
  • Forum
SiliconvlsiSiliconvlsi
Home»Linux»last Command in Linux
Linux

last Command in Linux

siliconvlsiBy siliconvlsiJanuary 20, 2024Updated:January 20, 2024No Comments2 Mins Read
Facebook Pinterest LinkedIn Email WhatsApp
Share
Facebook Twitter LinkedIn Pinterest Email

last Command in Linux

last Command in Linux:

The last command in Linux is used to find information about previously logged-in users. It retrieves data from the /var/log/wtmp file, which stores login and logout information. The output includes details like the username, connection method, IP address (for remote connections), duration of login, and date/time.

Syntax:

last

Example:

$ last

Output Explanation

The first column shows the username of the logged-in user. The second column indicates how the user is connected to the system. For example, pts signifies a pseudo-terminal used for remote connections. :0 indicates a local terminal. The third column displays the user’s IP address for remote connections or :0 for local terminals. In cases of system reboots, the kernel version is shown. The remaining columns show the timing activity of users, including the duration for which they were logged in.

Options

last -n <number>: Display a specified number of lines.

$ last -n 5

last -R: Disable displaying the hostname.

$ last -R

last -a: Display the hostname in the last column.

$ last -a

last -F: Display full login and logout time.

$ last -F

last <username>: Display information for a specific username.

$ last siliconvlsi

last -x: Display the last shutdown time.

$ last -x

These options provide flexibility in tailoring the output based on specific requirements, such as limiting the number of lines, including hostnames, or focusing on a particular username.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

Related Posts

Delete words after certain word in each line in gvim

January 28, 2024

Linux date Command

January 22, 2024

What is a Linux locate Command?

January 22, 2024
Leave A Reply Cancel Reply

Facebook X (Twitter) Instagram Pinterest Vimeo YouTube
  • About Us
  • Contact Us
  • Privacy Policy
© 2025 Siliconvlsi.

Type above and press Enter to search. Press Esc to cancel.