For ease of use, make sure to set your username via the P4USER environment variable first, then use p4 login and p4 logout You could also use p4 -u .